Repository navigation
Python: Add shared Foundry resource attribute to telemetry - #9589
Open
Hanchi Wang (luigiw) wants to merge 1 commit into
Open
Hanchi Wang (luigiw) wants to merge 1 commit into
Hanchi Wang (luigiw) wants to merge 1 commit into
Conversation
Include the microsoft.foundry string marker in Python telemetry resources and existing .NET telemetry samples. Share resource configuration across logs, traces, and metrics, preserve Python overrides, and document consumer-managed resources. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: be969812-8beb-4f72-ac73-3007f1f58671
Hanchi Wang (luigiw)
requested review from
SergeyMenshykh,
Tao Chen (TaoChenOSU),
Vincent Biret (baywet),
Eduard van Valkenburg (eavanvalkenburg),
Giles Odigwe (giles17),
Jose Alvarez (jpalvarezl),
Evan Mattson (moonbox3),
Peter Ibekwe (peibekwe),
Roger Barreto (rogerbarreto),
sophia-ramsey and
westey (westey-m)
as code owners
October 22, 2026 06:48
Hanchi Wang (luigiw)
deployed
to
github-app-auth
October 22, 2026 06:48 — with
GitHub Actions
Active
Hanchi Wang (luigiw)
deployed
to
github-app-auth
October 22, 2026 06:48 — with
GitHub Actions
Active
Hanchi Wang (luigiw)
deployed
to
github-app-auth
October 22, 2026 06:49 — with
GitHub Actions
Active
Hanchi Wang (luigiw)
deployed
to
github-app-auth
October 22, 2026 06:49 — with
GitHub Actions
Active
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Static review identified no blocking issues in these narrowly scoped resource changes; Python regression tests cover the key behavior, though tests were not executed.
No open issues 🎉
What changed in this PR
Adds the string resource attribute "microsoft.foundry": "True" to Python telemetry defaults and existing .NET samples, consistently identifying telemetry across configured providers.
Changes:
- Adds the Python default marker while preserving resource override precedence, with tests for defaults and shared resources across logs, traces, and metrics.
- Updates .NET samples to include the marker, shares resource configuration in AgentOpenTelemetry, and includes resource attributes in harness file exports.
- Documents resource behavior and configuration for consumer-managed providers.
| File | Description |
|---|---|
| python/packages/core/tests/core/test_observability.py | Tests marker defaults, overrides, and cross-signal resource sharing. |
| python/packages/core/README.md | Documents defaults and consumer-managed resources. |
| python/packages/core/agent_framework/observability.py | Adds and documents the default resource marker. |
| dotnet/samples/05-end-to-end/DevUIAspireIntegration/DevUIIntegration.ServiceDefaults/Extensions.cs | Adds the marker to shared telemetry configuration. |
| dotnet/samples/05-end-to-end/AgentWebChat/AgentWebChat.ServiceDefaults/ServiceDefaultsExtensions.cs | Adds the marker to shared telemetry configuration. |
| dotnet/samples/04-hosting/FoundryHostedAgents/responses/Hosted-Observability/Program.cs | Configures the hosted sample’s resource marker. |
| dotnet/samples/03-workflows/Observability/WorkflowAsAnAgent/Program.cs | Marks the workflow telemetry resource. |
| dotnet/samples/03-workflows/Observability/AspireDashboard/Program.cs | Marks the dashboard sample’s telemetry resource. |
| dotnet/samples/03-workflows/Observability/ApplicationInsights/Program.cs | Marks the Application Insights telemetry resource. |
| dotnet/samples/02-agents/Harness/Harness_Shared_Console/HarnessTracing.cs | Adds the marker to harness tracing. |
| dotnet/samples/02-agents/Harness/Harness_Shared_Console/FileSpanExporter.cs | Writes resource attributes to trace files. |
| dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step04_ProductionReady/ClawAgent.Console/Program.cs | Marks the console app’s shared telemetry resource. |
| dotnet/samples/02-agents/Agents/Agent_Step05_Observability/Program.cs | Adds the marker to agent tracing. |
| dotnet/samples/02-agents/AgentProviders/foundry/Agent_Step07_Observability/Program.cs | Adds the marker to Foundry agent tracing. |
| dotnet/samples/02-agents/AgentOpenTelemetry/README.md | Explains shared resources and consumer configuration. |
| dotnet/samples/02-agents/AgentOpenTelemetry/Program.cs | Shares marked resource configuration across all three signals. |
Review effort: Balanced
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Include the microsoft.foundry string marker in Python telemetry resources and existing .NET telemetry samples. Share resource configuration across logs, traces, and metrics, preserve Python overrides, and document consumer-managed resources.
Motivation & Context
Description & Review Guide
Related Issue
Fixes #
AI Assistance
AI assistance details:
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.