Skip to content

Enable Agent Framework GenAI message events - #270

Merged
Hector Hernandez (hectorhdzg) merged 11 commits into
microsoft:mainfrom
hectorhdzg:hectorhdzg-support-message-events
Sep 29, 2026
Merged

Hector Hernandez (hectorhdzg) merged 11 commits into
microsoft:mainfrom
hectorhdzg:hectorhdzg-support-message-events

Conversation

@hectorhdzg

Copy link
Copy Markdown
Member

Summary

  • enable Agent Framework GenAI message events by default
  • support enable_message_events and force through instrumentation_options["agent_framework"]
  • preserve compatibility with released Agent Framework versions that do not yet expose enable_message_events
  • document all Agent Framework configuration options supported by the distro
  • add coverage for defaults, overrides, forced re-enablement, and legacy API compatibility

This consumes the Agent Framework API added for microsoft/agent-framework#8412.

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Performance comparison

Threshold: regressions >15.0% on gating scenarios fail the build. Higher ops/s is better; positive Δ means the PR is slower.

Scenario Gating Baseline (ops/s) Candidate (ops/s) Δ % Status
azure_monitor_log yes 31,789.4 31,819.8 -0.10% ✅
azure_monitor_span yes 211,327.1 212,652.8 -0.62% ✅
otel_log no 36,588.5 36,953.5 -0.99% ✅
otel_span no 62,837.8 62,798.3 +0.06% ✅

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.

🟡 Changes recommended

force=True is not forwarded, and its configuration is not documented.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Enables Agent Framework GenAI message events by default with legacy API compatibility and configurable instrumentation options.

Changes:

  • Adds message-event defaults, overrides, and compatibility handling.
  • Expands tests for configuration and legacy signatures.
  • Documents the feature and records it in the changelog.
File summaries
File Summary
tests/test_agent_framework_integration.py Updates integration expectations.
tests/agent_framework/test_trace_instrumentor.py Tests defaults, overrides, forced behavior, and legacy compatibility.
src/microsoft/opentelemetry/_agent_framework/_trace_instrumentor.py Forwards Agent Framework instrumentation settings; force is not currently forwarded.
README.md Documents Agent Framework options; force documentation is missing.
CHANGELOG.md Records the new feature.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/microsoft/opentelemetry/_agent_framework/_trace_instrumentor.py
Comment thread README.md

@rads-1996 Radhika Gupta (rads-1996) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Two things here -

We should probably the bump the minimum version or atleast recommend the version of agent-framework in which this feature is available and we could also add a sample app.

Comment thread CHANGELOG.md
Comment thread src/microsoft/opentelemetry/_agent_framework/_trace_instrumentor.py Outdated

@rads-1996 Radhika Gupta (rads-1996) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we also update the min version for agent-framework in pyproject.toml?

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Forward and document the force option, cover forced re-enablement, and move the optional dependency API contract into the integration suite that installs Agent Framework.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep the API contract in the integration suite while allowing the base pytest environments to collect tests without the optional Agent Framework dependency.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Avoid conditional loading of the optional Agent Framework dependency; the minimum version and instrumentor behavior remain covered by package metadata and unit tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread README.md
)
```

For Agent Framework, `enable_sensitive_data` controls prompt, completion,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

They’re separate settings, but message events are only emitted when sensitive-data capture is also enabled. So setting enable_message_events=True by itself won’t emit message content if enable_sensitive_data=False

@hectorhdzg
Hector Hernandez (hectorhdzg) merged commit f4abb9e into microsoft:main Sep 29, 2026
12 checks passed
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.

4 participants