Skip to content

Agent365 OpenTelemetry: Agent365 baggage bridge - #516

Merged
heyitsaamir merged 14 commits into
feature_agent365_supportfrom
heyitsaamir-python-otel-docs
Jul 31, 2026
Merged

Agent365 OpenTelemetry: Agent365 baggage bridge#516
heyitsaamir merged 14 commits into
feature_agent365_supportfrom
heyitsaamir-python-otel-docs

Conversation

@heyitsaamir

@heyitsaamir heyitsaamir commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds the Agent365 OpenTelemetry baggage bridge on top of the token-provider surface in #530. This is the middle layer of a three-PR stack; the Microsoft OpenTelemetry dependency and runnable example remain in the top PR.

The bridge establishes Agent365 identity context before the SDK's root turn span, so Apps, API, auth, and host-created Agent365 spans share one context. It also provides a reusable scope opener for proactive work, where there is no inbound activity to derive identity from.

Decisions

  • Enabled by default, explicitly disableable. Inbound turns receive identifier-only Agent365 baggage unless telemetry={"agent365": False} is set. This matches the TypeScript SDK and keeps the enrichment at the single app-processing chokepoint.
  • Personal fields require explicit opt-in. Names, emails, and descriptions are controlled independently through the include list; message content is never baggage. user.id remains in the default pseudonymous identifier set for cross-language parity.
  • Standard OpenTelemetry boundary. SDK packages use only the standard OpenTelemetry API and configure no exporter or propagator. The host owns the OTel SDK and Microsoft distro.
  • Current Agent365 identity model. Proactive scopes accept AgenticUser, matching the current Python SDK's agentic_app_instance_id, agentic_user_id, and blueprint terminology.

Deferred

Exporter authentication, Microsoft OpenTelemetry configuration, reactive/proactive sample wiring, and the resulting lockfile change are isolated in the top example PR.

Validation

The complete stack was validated live through Teams: the fresh Python trace appeared in Aspire with Apps/API/auth/invoke_agent nesting, and Defender produced Agent365 InvokeAgent rows. This isolated layer also passes its focused Apps test suite, Ruff, and Pyright.

@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-docs branch from 6858dc9 to b31aac8 Compare July 22, 2026 14:27
@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
@heyitsaamir
heyitsaamir force-pushed the heyitsaamir-python-otel-docs branch from d984f8d to 0342e58 Compare July 22, 2026 21:32
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8398c990-e5b5-41b6-8d04-0519128726c1
@heyitsaamir
heyitsaamir changed the base branch from feature_agent365_support to heyitsaamir-agent365-token-provider July 30, 2026 15:27
@heyitsaamir
heyitsaamir force-pushed the heyitsaamir-python-otel-docs branch from 0342e58 to c8744d4 Compare July 30, 2026 15:27
@heyitsaamir heyitsaamir changed the title Add explicit Agent365 baggage bridge Agent365 OpenTelemetry: Agent365 baggage bridge Jul 30, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8398c990-e5b5-41b6-8d04-0519128726c1
@heyitsaamir
heyitsaamir force-pushed the heyitsaamir-python-otel-docs branch from c8744d4 to e8794a3 Compare July 30, 2026 20:48
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8398c990-e5b5-41b6-8d04-0519128726c1
@heyitsaamir
heyitsaamir force-pushed the heyitsaamir-python-otel-docs branch from e8794a3 to 77b05b8 Compare July 30, 2026 22:54
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8398c990-e5b5-41b6-8d04-0519128726c1
@heyitsaamir
heyitsaamir force-pushed the heyitsaamir-python-otel-docs branch from 77b05b8 to 9285292 Compare July 30, 2026 23:04
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8398c990-e5b5-41b6-8d04-0519128726c1
@heyitsaamir
heyitsaamir force-pushed the heyitsaamir-python-otel-docs branch from 9285292 to a98f560 Compare July 30, 2026 23:10
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8398c990-e5b5-41b6-8d04-0519128726c1
@heyitsaamir
heyitsaamir force-pushed the heyitsaamir-python-otel-docs branch from a98f560 to eebad6e Compare July 30, 2026 23:58
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8398c990-e5b5-41b6-8d04-0519128726c1
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
Build the Agent365 baggage bridge on the public token-provider layer. Establish identifier-only inbound baggage before the root turn span, support explicit opt-out and granular personal-data includes, and expose reusable proactive scopes without configuring exporters.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>\nCopilot-Session: 0d367487-e88d-4423-8016-475637d47ed0
@heyitsaamir
heyitsaamir force-pushed the heyitsaamir-python-otel-docs branch from eebad6e to 3aa5731 Compare July 31, 2026 00:03
Base automatically changed from heyitsaamir-agent365-token-provider to feature_agent365_support July 31, 2026 03:58
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 merged commit 3781421 into feature_agent365_support Jul 31, 2026
5 checks passed
@heyitsaamir
heyitsaamir deleted the heyitsaamir-python-otel-docs branch July 31, 2026 04:02
@heyitsaamir heyitsaamir mentioned this pull request Aug 1, 2026
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