Skip to content

Add OpenTelemetry app diagnostics - #515

Merged
heyitsaamir merged 2 commits into
feature_agent365_supportfrom
heyitsaamir-python-otel-apps
Jul 22, 2026
Merged

Add OpenTelemetry app diagnostics#515
heyitsaamir merged 2 commits into
feature_agent365_supportfrom
heyitsaamir-python-otel-apps

Conversation

@heyitsaamir

@heyitsaamir heyitsaamir commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Adds the Apps-side OpenTelemetry layer: inbound activity processing and handler telemetry.

Why

This gives developers the other half of the story: Teams called the app, the SDK processed the activity, and the right handler ran. When paired with the API layer below it, the trace reads like: inbound activity → handler → outbound Teams API → auth. Much less spelunking in logs, thank goodness.

This PR intentionally leaves Agent365-specific integration out of the SDK telemetry pass because that will land separately.

Interesting bits

  • Adds microsoft.teams.activity.process around inbound activity processing.
  • Adds microsoft.teams.handler around handler dispatch.
  • Adds Apps metrics for activity processing and handler dispatch/duration.
  • Uses Microsoft.Teams.Apps as the instrumentation scope, with the package version attached as the scope version.
  • Restores Apps compatibility surfaces that the middleware refactor touched, including send/reply scoping and HTTP server compatibility.
  • Removes the Agent365 baggage helper/export path from this stack.

Reviewer tips

Start with the app processing path, then check handler telemetry and the compatibility follow-up. This PR stacks on the API layer, so API outbound spans live in the parent PR.

Testing

Targeted Apps diagnostics/process tests pass after removing baggage. CI will rerun for this layer. The full stack was also live-smoked against Agent365/ACF and Echo/PokemonCatcher before splitting, with Aspire showing the expected Apps/API span nesting.

@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-apps branch from b8f9702 to 18a5d99 Compare July 22, 2026 14:27
Base automatically changed from heyitsaamir-python-otel-api to feature_agent365_support July 22, 2026 21:14
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-apps branch from 18a5d99 to 2dae576 Compare July 22, 2026 21:16
@heyitsaamir
heyitsaamir merged commit fc4cbc0 into feature_agent365_support Jul 22, 2026
5 checks passed
@heyitsaamir
heyitsaamir deleted the heyitsaamir-python-otel-apps branch 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.

2 participants