Skip to content

Add OpenTelemetry support for .NET SDK #181

@reachanihere

Description

@reachanihere

Add distributed tracing and metrics instrumentation to the .NET SDK using OpenTelemetry.

Features:

  • Opt-in via AppContext.SetSwitch("GitHub.Copilot.EnableOpenTelemetry", true) or environment variable
  • Spans: copilot.session, copilot.turn, copilot.tool_execution, copilot.subagent, copilot.hook, copilot.inference
  • Metrics: token usage, cost, tool executions, errors, duration
  • Follows GenAI Semantic Conventions

Benefits:

  • End-to-end visibility into Copilot SDK operations
  • Integration with any OpenTelemetry-compatible backend (Jaeger, Zipkin, Azure Monitor, Datadog, etc.)
  • Consistent with OpenAI SDK's opt-in telemetry pattern

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions