feat(observability): add OpenTelemetry distributed tracing export#344
Merged
AbirAbbas merged 3 commits intoAgent-Field:mainfrom Apr 7, 2026
Merged
Conversation
Add OTel trace export to the control plane execution pipeline. Each execution creates a root span, and reasoner/skill invocations create child spans with execution metadata as span attributes. - New `control-plane/internal/observability/` package with TracerProvider initialization (OTLP HTTP exporter) and ExecutionTracer that subscribes to the existing execution and reasoner event buses - TracingConfig added to FeatureConfig with YAML config and env var overrides (OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_SERVICE_NAME) - Disabled by default; opt in via `features.tracing.enabled: true` or AGENTFIELD_TRACING_ENABLED=true - Integrated into server lifecycle (start/shutdown with graceful flush) - 10 unit tests covering tracer init, span parent-child relationships, execution lifecycle, duplicate handling, and shutdown cleanup
The initial OTel dependency pull upgraded transitive deps (golang.org/x/*, grpc) that require Go 1.25, but CI uses Go 1.24. Pin OTel to v1.32-v1.35 and restore the original grpc/x/ versions.
Resolve go.mod/go.sum conflicts from main branch updates (newer golang.org/x/*, grpc, protobuf versions). Default tracing insecure config to false to prevent accidental unencrypted trace export in production. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AbirAbbas
approved these changes
Apr 7, 2026
Contributor
Author
|
Tx for the merge @AbirAbbas ! |
This was referenced Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add OpenTelemetry trace export to the control plane execution pipeline. Each execution creates a root span, and reasoner/skill invocations create child spans with execution metadata (agent ID, execution ID, workflow ID) as span attributes. Exports via OTLP HTTP to any OTel-compatible backend (Jaeger, Grafana Tempo, Langfuse).
This builds on the existing observability infrastructure in
execution_metrics.go(Prometheus counters/histograms) andobservability_forwarder.go(webhook event forwarding) by adding distributed tracing as a third observability signal.Note: I based direction of this on PR #342 (execution observability RFC)
Changes
control-plane/internal/observability/package:tracer.go: TracerProvider initialization with OTLP HTTP exporter, resource attributes, and span helper methods (StartExecutionSpan,StartStepSpan,RecordError)execution_tracer.go: Subscribes toGlobalExecutionEventBusandGlobalReasonerEventBus, translates events into OTel spans with parent-child relationships matching the execution DAGTracingConfigadded toFeatureConfiginconfig.gowith env var overrides (OTEL_EXPORTER_OTLP_ENDPOINT,OTEL_SERVICE_NAME,AGENTFIELD_TRACING_ENABLED)server.go: initialization inNewAgentFieldServer, start inStart(), graceful flush in shutdownagentfield.yaml(disabled by default)Demo
Testing
./scripts/test-all.sh(all control-plane tests pass)go build ./...passes with no compilation errorsChecklist
CHANGELOG.md(or this change does not warrant a changelog entry).Screenshots (if UI-related)
N/A - backend observability feature, no UI changes.
Related issues
Relates to #342 (execution observability RFC)
This contribution was developed with AI assistance (Claude Code).