Skip to content

Add explicit Agent365 baggage bridge - #516

Open
heyitsaamir wants to merge 6 commits into
feature_agent365_supportfrom
heyitsaamir-python-otel-docs
Open

Add explicit Agent365 baggage bridge#516
heyitsaamir wants to merge 6 commits into
feature_agent365_supportfrom
heyitsaamir-python-otel-docs

Conversation

@heyitsaamir

@heyitsaamir heyitsaamir commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Adds the explicit Agent365 baggage bridge and documents the app-level Microsoft OTel setup around it.

Why

Agent365 observability should be wired by the app, not hidden inside generic Teams SDK telemetry. This keeps the SDK boundary tidy: Teams.py emits SDK spans/metrics and provides an opt-in Agent365 baggage bridge; app code owns Microsoft OpenTelemetry setup, token auth, exporters, and Agent365 scopes. Almost suspiciously reasonable.

Interesting bits

  • Adds agent365_baggage(...) and Agent365Baggage as the explicit context-manager bridge.
  • Uses only standard OpenTelemetry API baggage/context in SDK code; no microsoft-opentelemetry or Microsoft Agents SDK dependency in SDK packages.
  • Maps conservative Agent365 correlation context from Teams activity by default: tenant, conversation, channel, agent/app identity, user ID, and optional invoke-agent server details.
  • Keeps message content, attachments, names, and emails out of baggage by default; display identity details require an explicit opt-in.
  • Updates Agent365 docs with app-level Microsoft OTel setup, explicit baggage usage, resolver/auth guidance, and content/output logging left off by default.

Reviewer tips

Start with the small bridge in Apps diagnostics, then the tests that prove it is opt-in and dependency-free. The README is the contract for how app code combines agent365_baggage(...) with Microsoft OTel/Agent365 scopes.

Testing

Targeted Apps diagnostics/process tests pass locally. CI will rerun for the updated branch.

@corinagum corinagum 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.

Same feedback as TS

@heyitsaamir
heyitsaamir force-pushed the heyitsaamir-python-otel-docs branch from c20ab44 to 9dae172 Compare July 21, 2026 00:23
@heyitsaamir heyitsaamir changed the title Document Python OpenTelemetry diagnostics Add explicit Agent365 baggage bridge Jul 21, 2026
@heyitsaamir
heyitsaamir force-pushed the heyitsaamir-python-otel-apps branch from b8f9702 to 18a5d99 Compare July 22, 2026 14:27
@heyitsaamir
heyitsaamir force-pushed the heyitsaamir-python-otel-docs branch from 6858dc9 to b31aac8 Compare July 22, 2026 14:27
@heyitsaamir
heyitsaamir force-pushed the heyitsaamir-python-otel-apps branch from 18a5d99 to 2dae576 Compare July 22, 2026 21:16
@heyitsaamir
heyitsaamir force-pushed the heyitsaamir-python-otel-docs branch from b31aac8 to d984f8d Compare July 22, 2026 21:16
Base automatically changed from heyitsaamir-python-otel-apps to feature_agent365_support July 22, 2026 21:32
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 0d367487-e88d-4423-8016-475637d47ed0
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 0d367487-e88d-4423-8016-475637d47ed0
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 0d367487-e88d-4423-8016-475637d47ed0
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 0d367487-e88d-4423-8016-475637d47ed0
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 0d367487-e88d-4423-8016-475637d47ed0
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 0d367487-e88d-4423-8016-475637d47ed0
@heyitsaamir
heyitsaamir force-pushed the heyitsaamir-python-otel-docs branch from d984f8d to 0342e58 Compare July 22, 2026 21:32
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