Skip to content

Add semantic kernel and agent framework instrumentations - #50

Merged
Radhika Gupta (rads-1996) merged 15 commits into
microsoft:mainfrom
rads-1996:add-semantic-agent-framework
Apr 22, 2026
Merged

Radhika Gupta (rads-1996) merged 15 commits into
microsoft:mainfrom
rads-1996:add-semantic-agent-framework

Conversation

@rads-1996

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-party instrumentations for Semantic Kernel and an Agent Framework to the microsoft-opentelemetry distro, wiring them into the distro’s entry-point discovery and expanding test coverage for configuration defaults and span enrichment behavior.

Changes:

  • Added new SemanticKernelInstrumentor/AgentFrameworkInstrumentor implementations with span processors + span enrichers.
  • Registered both instrumentors via pyproject.toml opentelemetry_instrumentor entry points and enabled them by default via _SUPPORTED_INSTRUMENTED_LIBRARIES.
  • Added unit tests for the new instrumentors/enrichers/utils and added Agent Framework integration tests; updated Azure Monitor configuration tests to include the new instrumentation keys.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
src/microsoft/opentelemetry/_semantic_kernel/_trace_instrumentor.py Adds Semantic Kernel instrumentor that installs a span processor and registers an enricher.
src/microsoft/opentelemetry/_semantic_kernel/_span_processor.py Adds SK span processor that renames chat.* spans and sets gen_ai.operation.name.
src/microsoft/opentelemetry/_semantic_kernel/_span_enricher.py Adds SK enricher mapping/transforming GenAI span attributes before export.
src/microsoft/opentelemetry/_semantic_kernel/_utils.py Adds SK message-content extraction helper.
src/microsoft/opentelemetry/_semantic_kernel/__init__.py Exposes SemanticKernelInstrumentor.
src/microsoft/opentelemetry/_agent_framework/_trace_instrumentor.py Adds Agent Framework instrumentor that installs a span processor and registers an enricher.
src/microsoft/opentelemetry/_agent_framework/_span_processor.py Adds Agent Framework span processor (currently intended as no-op).
src/microsoft/opentelemetry/_agent_framework/_span_enricher.py Adds Agent Framework enricher for message/tool attribute normalization.
src/microsoft/opentelemetry/_agent_framework/_utils.py Adds Agent Framework message “parts” parsing helpers (role-filtered).
src/microsoft/opentelemetry/_agent_framework/__init__.py Exposes AgentFrameworkInstrumentor.
src/microsoft/opentelemetry/_constants.py Enables semantic_kernel and agent_framework as supported instrumentations.
pyproject.toml Registers the new instrumentors in the opentelemetry_instrumentor entry-point group.
tests/azure_monitor/utils/test_configurations.py Updates expected default/merged instrumentation options to include new instrumentations.
tests/semantic_kernel/test_trace_instrumentor.py Unit tests for SK instrumentor and SK span processor.
tests/semantic_kernel/test_span_enricher.py Unit tests for SK span enricher.
tests/semantic_kernel/__init__.py Package marker + license header.
tests/agent_framework/test_utils.py Unit tests for Agent Framework utils message parsing.
tests/agent_framework/test_trace_instrumentor.py Unit tests for Agent Framework instrumentor and span processor.
tests/agent_framework/test_span_enricher.py Unit tests for Agent Framework span enricher.
tests/agent_framework/integration/conftest.py Integration-test fixtures and optional .env loading.
tests/agent_framework/integration/test_agentframework_trace_processor.py Real-Azure-OpenAI integration tests for Agent Framework tracing pipeline.
tests/agent_framework/__init__.py Package marker + license header.
tests/agent_framework/integration/__init__.py Package marker + license header.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/microsoft/opentelemetry/_agent_framework/_span_processor.py
Comment thread src/microsoft/opentelemetry/_semantic_kernel/_trace_instrumentor.py Outdated
Comment thread src/microsoft/opentelemetry/_semantic_kernel/_trace_instrumentor.py
Comment thread src/microsoft/opentelemetry/_semantic_kernel/_trace_instrumentor.py Outdated
Comment thread src/microsoft/opentelemetry/_agent_framework/_trace_instrumentor.py Outdated
Comment thread src/microsoft/opentelemetry/_agent_framework/_trace_instrumentor.py
Comment thread src/microsoft/opentelemetry/_agent_framework/_trace_instrumentor.py Outdated
Comment thread tests/agent_framework/integration/conftest.py
@rads-1996
Radhika Gupta (rads-1996) merged commit f833898 into microsoft:main Apr 22, 2026
8 checks passed
@rads-1996
Radhika Gupta (rads-1996) deleted the add-semantic-agent-framework branch April 22, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants