You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add OpenTelemetry tracing for agent execution (#89)
* feat: add OpenTelemetry tracing for agent execution
Add distributed tracing across the full agent request lifecycle:
LLM API calls, agentic tool loop iterations, tool execution,
HTTP request handling, and A2A delegation. Conversation content
(messages, tool args/results) is captured as span events with
10KB truncation. Token usage is recorded as span attributes.
Tracing is zero-overhead when disabled (OTel no-op provider).
Three export modes: OTLP gRPC (Jaeger/Tempo), stdout JSON
(kubectl logs), or both simultaneously.
New flags: --otel-enabled, --otel-collector-endpoint, --otel-stdout
Closes#34
Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Pavel Anni <panni@redhat.com>
* fix: rename ZT-AGENT to DOCSCLAW and auto-detect log format
Rename the logger component from the legacy "ZT-AGENT" (Zero Trust
demo) to "DOCSCLAW". Auto-detect output format based on TTY: color
text for local dev terminals, structured JSON for K8s pods and pipes.
Override with LOG_FORMAT=json|text. SPIFFE_DEMO_LOG_FORMAT kept as
legacy alias. NO_COLOR still respected in text mode.
Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Pavel Anni <panni@redhat.com>
* fix: address code review findings for OTel tracing
- Fix statusWriter to implement http.Flusher (and Unwrap) so SSE
streaming continues to work through the OTel HTTP middleware
- Remove codes.Error from denied tool calls — policy denial is
expected behavior, not an operational error
- Set error status on loopSpan for max iterations and context
cancellation so these are distinguishable from success in traces
- Add response content and token usage as span events/attributes
on both providers' Complete methods (closes observability gap)
- Extract W3C baggage header alongside traceparent in A2A executor
Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Pavel Anni <panni@redhat.com>
* fix: address CodeRabbit review findings
- Fix truncate to account for suffix length in byte budget so
result never exceeds maxBytes
- Default OTLP gRPC to TLS; only use insecure when explicitly set
to OTEL_EXPORTER_OTLP_INSECURE=true
- Save/restore global TracerProvider in test instead of always
setting noop
- Set loopSpan error status when CompleteWithTools fails so parent
span reflects child failure
- Add span error status to all error paths in both providers'
Complete methods
- Give OTel shutdown its own timeout context separate from HTTP
server shutdown
Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Pavel Anni <panni@redhat.com>
---------
Signed-off-by: Pavel Anni <panni@redhat.com>
0 commit comments