Skip to content

Python: Add OpenTelemetry integration for GitHubCopilotAgent #5141

@droideronline

Description

@droideronline

Summary

GitHubCopilotAgent currently has no OpenTelemetry instrumentation. This issue tracks adding OTel tracing support following the same pattern used by other agents in the framework (e.g., ClaudeAgent, FoundryAgent).

Proposed Changes

  • Split GitHubCopilotAgent into two classes:
    • RawGitHubCopilotAgent - core implementation without telemetry layers
    • GitHubCopilotAgent(AgentTelemetryLayer, RawGitHubCopilotAgent) - OTel-enabled wrapper (recommended for most use cases)
  • Add a default_options property to expose the configured model name in span attributes
  • Export RawGitHubCopilotAgent from all public namespaces (agent_framework.github, agent_framework_github_copilot)
  • Add a new sample github_copilot_with_observability.py showing how to use configure_otel_providers() with GitHubCopilotAgent
  • Update the GitHub Copilot samples README with OTel environment variable documentation

Usage After This Change

from agent_framework.github import GitHubCopilotAgent
from agent_framework.observability import configure_otel_providers

# Enable OTel tracing (configure OTEL_EXPORTER_OTLP_ENDPOINT for a collector)
configure_otel_providers()

async with GitHubCopilotAgent(instructions="You are a helpful assistant.") as agent:
    response = await agent.run("Hello!")
    print(response)

Users who want the agent without any telemetry overhead can use RawGitHubCopilotAgent directly.

Related

  • Follows the same Raw* / Telemetry-enabled pattern as RawClaudeAgent / ClaudeAgent
  • Depends on the SDK 0.2.x migration (tracked separately)

Metadata

Metadata

Assignees

Labels

agentsIssues related to single agentspython

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions