Skip to content

feat: Add OpenTelemetry Spans Across Server, LLM, and Tool - #16

Open
ThomasHartDev wants to merge 2 commits into
mainfrom
thomas/feat/otel
Open

feat: Add OpenTelemetry Spans Across Server, LLM, and Tool#16
ThomasHartDev wants to merge 2 commits into
mainfrom
thomas/feat/otel

Conversation

@ThomasHartDev

Copy link
Copy Markdown
Owner

Adds @agent/telemetry with process-wide TracerProvider, parent/child agent.turn → agent.llm/agent.tool spans via withAgentTurn + SpanTelemetry, and env-gated OTLP HTTP export. Server wires default SpanTelemetry and turn wrapping. OTel packages are pinned to one release train (sdk-trace-base/node/resources 2.0.1 + exporter 0.203.0). Shutdown clears the global provider/context so re-init works in-process.

Real TracerProvider with parent/child spans across agent.turn → agent.llm
→ agent.tool. OTLP HTTP export stays off unless OTEL_EXPORTER_OTLP_ENDPOINT
is set so local and CI stay quiet.
Pin sdk-trace-base/node/resources to 2.0.1 with exporter 0.203.0
so only one sdk-trace-base is installed. Call trace.disable() and
context.disable() on shutdown so a second initTracing registers a
live provider. Tighten the no-tool hierarchy test and cover re-init
plus otlpEnabled when an endpoint is set.
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