-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Python: Add OpenTelemetry integration for GitHubCopilotAgent #5141
Copy link
Copy link
Open
Description
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
GitHubCopilotAgentinto two classes:RawGitHubCopilotAgent- core implementation without telemetry layersGitHubCopilotAgent(AgentTelemetryLayer, RawGitHubCopilotAgent)- OTel-enabled wrapper (recommended for most use cases)
- Add a
default_optionsproperty to expose the configured model name in span attributes - Export
RawGitHubCopilotAgentfrom all public namespaces (agent_framework.github,agent_framework_github_copilot) - Add a new sample
github_copilot_with_observability.pyshowing how to useconfigure_otel_providers()withGitHubCopilotAgent - 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-enabledpattern asRawClaudeAgent/ClaudeAgent - Depends on the SDK 0.2.x migration (tracked separately)
Reactions are currently unavailable