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
{{ message }}
Repository navigation
OpenTelemetry exporter for traces and metrics #990
Everything needed is already recorded — tool call, duration, status, upstream response — it just cannot leave the box in a standard format.
Scope
OTLP exporter behind OTEL_EXPORTER_OTLP_ENDPOINT, off when unset.
One span per MCP tool call, with a child span for the upstream request.
Attributes: connector, tool, MCP server, org, status, upstream status code. No parameter values and no response bodies — this is a product whose pitch is that data does not leave your network, and a trace exporter is an easy way to break that promise by accident.
Metrics: call count, duration histogram, error count, by tool.
Good issue for someone who has wired OTel into a NestJS app before.
Hi @helpcodeai, I'd like to work on this after #1963. I looked at what exists today: tracing.ts already exports HTTP/Express/DB spans over OTLP when OTEL_EXPORTER_OTLP_ENDPOINT is set, and since #984/metrics has the tool-call counters and latency histograms in Prometheus. What's missing is the tool call itself. I'd split it into small PRs:
A span per MCP tool call, following the OpenTelemetry MCP semantic conventions: name tools/call {tool}, attributes mcp.method.name, gen_ai.operation.name: execute_tool, gen_ai.tool.name, plus the connector type, connector id, MCP server id, org id, status, upstream status code and error.type on failure. The upstream HTTP request becomes its child span automatically. No parameter values or response bodies, and a no-op when OTLP is not configured.
OTLP metrics: call count, a duration histogram and errors by tool, the same numbers as /metrics, exported only when the endpoint is set.
(optional) Trace context from the client: continue the caller's trace when a tools/call carries traceparent in params._meta, as the MCP conventions describe.
Does this split work for you, and should tool names stay off Cloud spans like they do on the Prometheus labels?
Activity
AYUshJaiswal454 commentedon Dec 6, 2026
Hi @helpcodeai, I'd like to work on this after #1963. I looked at what exists today:
tracing.tsalready exports HTTP/Express/DB spans over OTLP whenOTEL_EXPORTER_OTLP_ENDPOINTis set, and since #984/metricshas the tool-call counters and latency histograms in Prometheus. What's missing is the tool call itself. I'd split it into small PRs:tools/call {tool}, attributesmcp.method.name,gen_ai.operation.name: execute_tool,gen_ai.tool.name, plus the connector type, connector id, MCP server id, org id, status, upstream status code anderror.typeon failure. The upstream HTTP request becomes its child span automatically. No parameter values or response bodies, and a no-op when OTLP is not configured./metrics, exported only when the endpoint is set.tools/callcarriestraceparentinparams._meta, as the MCP conventions describe.Does this split work for you, and should tool names stay off Cloud spans like they do on the Prometheus labels?