Repository navigation
Python: Add shared Foundry resource attribute to telemetry - #9589
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
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
Update Python resource defaults, .NET sample resources, documentation, and regression tests while retaining the string value True and override precedence. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: be969812-8beb-4f72-ac73-3007f1f58671
Fixes IDE0005 reported by the dotnet format gate. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: be969812-8beb-4f72-ac73-3007f1f58671
|
Hanchi Wang (@luigiw) The current head is clean, but the PR body still contains untouched required template placeholders: all three Description & Review Guide answers are blank, and Related Issue still says only |
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.