Skip to content

feat(server): OTLP trace export — ORCH8_OTLP_ENDPOINT with orch8.step spans#66

Merged
ovasylenko merged 2 commits into
mainfrom
feat/otlp-export
Jun 10, 2026
Merged

feat(server): OTLP trace export — ORCH8_OTLP_ENDPOINT with orch8.step spans#66
ovasylenko merged 2 commits into
mainfrom
feat/otlp-export

Conversation

@ovasylenko

Copy link
Copy Markdown
Contributor

Summary

The remaining half of FEATURE_OPPORTUNITIES item #10. OTLP trace export, enabled only when ORCH8_OTLP_ENDPOINT (or [telemetry] otlp_endpoint) is set — zero behavior change when unset.

  • otel 0.29 line pinned to unify with the workspace's tonic 0.12 (single tonic in the lockfile; upgrade note in workspace Cargo.toml). tracing-opentelemetry 0.30. Default-on otlp cargo feature with a no-op mirror for --no-default-features.
  • Batch exporter with resource attrs (service.name=orch8-server yielding to OTEL_SERVICE_NAME, version, OTEL_RESOURCE_ATTRIBUTES honored), per-layer filter dropping opentelemetry/tonic/h2/hyper targets so exporter errors can't feed back into the exporter, and graceful flush after drain on shutdown.
  • New orch8.step info-span around handler invocation on BOTH dispatch paths (flat scheduler + tree evaluator): instance_id, block_id, handler, tenant_id, attempt — identity only, no params/outputs. The existing gen_ai.client.inference event rides inside it.
  • gRPC protocol only; anything else rejected at startup validation with a clear error. .env.example + docs/CONFIGURATION.md updated.

Tests

9 new (config parsing, env overrides, inert-when-unset init, protocol rejection, smoke test against a non-listening endpoint — init/emit/flush all non-fatal, span emission). Suites: orch8-types+server 446 passed, orch8-engine 2086 passed. fmt/clippy (incl. --no-default-features)/doc/deny gates clean.

🤖 Generated with Claude Code

ovasylenko and others added 2 commits June 10, 2026 01:10
… spans

Adds optional OpenTelemetry trace export to orch8-server, enabled only
when ORCH8_OTLP_ENDPOINT (config: [telemetry] otlp_endpoint) is set:

- New [telemetry] config section (otlp_endpoint, otlp_protocol) with env
  overrides ORCH8_OTLP_ENDPOINT / ORCH8_OTLP_PROTOCOL (grpc only) and
  startup validation. Unset endpoint = zero behavior change.
- orch8-server gains a default-on `otlp` cargo feature wiring
  tracing-opentelemetry onto the existing subscriber (fmt + env-filter
  preserved), with a self-feedback filter so exporter errors can't loop
  back into the exporter. Tracer provider is flushed on graceful
  shutdown after the engine drains.
- OTel 0.29 line pinned (opentelemetry/opentelemetry_sdk/-otlp 0.29,
  tracing-opentelemetry 0.30): newest releases whose grpc-tonic
  transport links against the workspace's tonic 0.12 (0.30+ needs 0.13).
- Engine emits an `orch8.step` span around every step-handler
  invocation (flat + tree paths) with instance_id, block_id, handler,
  tenant_id, attempt — the existing gen_ai.client.inference event from
  llm_call rides inside it. Identity fields only; no params/outputs.
- Tests: config parsing (set/unset/protocol validation), env override
  round-trip, subscriber smoke test against a non-listening endpoint
  (init + flush must be non-fatal), and a tracing-layer test asserting
  the orch8.step span wraps a mock handler with the expected fields.
- Docs: .env.example + docs/CONFIGURATION.md telemetry sections.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ovasylenko ovasylenko merged commit dc68442 into main Jun 10, 2026
10 checks passed
@ovasylenko ovasylenko deleted the feat/otlp-export branch June 10, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant