Skip to content

[Observability 9/10] Add OTEL distributed tracing to MCP server #316

Description

@concaf

Context

Add OpenTelemetry distributed tracing with spans across the full MCP request lifecycle: HTTP request → auth middleware → tool handler → downstream calls (Snowflake, embedding, K8s). This provides end-to-end visibility for debugging slow or failed requests.

Scope (to be detailed)

  • Add TracerProvider initialization to pkg/telemetry/
  • Create spans in tool handlers
  • Propagate trace context to downstream HTTP calls (embedding client) and database calls (Snowflake)
  • Connect with the request_id already generated in logger.NewContext

Use cases enabled

E4 (full end-to-end trace correlation)

Depends on

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgoPull requests that update go codeobservabilityMetrics, tracing, alerting, and monitoring

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions