Skip to content

Python: Add shared Foundry resource attribute to telemetry - #9589

Open
Hanchi Wang (luigiw) wants to merge 1 commit into
microsoft:mainfrom
luigiw:luigiw-foundry-telemetry-attributes
Open

Hanchi Wang (luigiw) wants to merge 1 commit into
microsoft:mainfrom
luigiw:luigiw-foundry-telemetry-attributes

Conversation

@luigiw

@luigiw Hanchi Wang (luigiw) commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

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

  • What are the major changes?
  • What is the impact of these changes?
  • What do you want reviewers to focus on?

Related Issue

Fixes #

AI Assistance

  • No material AI assistance was used.
  • This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.

AI assistance details:

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR links to an agreed issue with no competing open PR, or the Related Issue section documents a trivial-change or repository-automation exception.
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

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
Copilot AI balanced review requested due to automatic review settings October 22, 2026 06:48
@agent-framework-automation agent-framework-automation Bot added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python .NET Usage: [Issues, PRs], Target: .Net workflows Usage: [Issues, PRs], Target: Workflows labels Oct 22, 2026
@github-actions github-actions Bot changed the title Add shared Foundry resource attribute to telemetry .NET: Add shared Foundry resource attribute to telemetry Oct 22, 2026
@github-actions github-actions Bot changed the title .NET: Add shared Foundry resource attribute to telemetry Python: Add shared Foundry resource attribute to telemetry Oct 22, 2026

Copilot AI 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.

🟢 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

1 active deployment
github-app-auth — 82f5f1a4 Deployed Oct 22, 2026 by luigiw via add_label #25893
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net python Usage: [Issues, PRs], Target: Python workflows Usage: [Issues, PRs], Target: Workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants