Skip to content

Copy service.name baggage onto all span attributes - #118

Merged
Nikhil Navakiran (nikhilNava) merged 2 commits into
mainfrom
copilot/fix-pull-258-issue
Jun 9, 2026
Merged

Nikhil Navakiran (nikhilNava) merged 2 commits into
mainfrom
copilot/fix-pull-258-issue

Conversation

Copilot AI commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

ServiceNameKey was missing from ActivityProcessor's AttributeKeys allow-list, so BaggageBuilder.OperationSource(...) had no effect on emitted telemetry—the baggage was set but never copied to spans.

  • Added OpenTelemetryConstants.ServiceNameKey to the global AttributeKeys array in ActivityProcessor
  • Added unit test OnStart_PropagatesServiceName_FromOperationSourceBaggage asserting that BaggageBuilder.OperationSource(...) is correctly coalesced onto eligible GenAI spans
  • Updated CHANGELOG.md with an entry for this fix

Ports the fix from microsoft/Agent365-dotnet#258.

Add OpenTelemetryConstants.ServiceNameKey to ActivityProcessor's
AttributeKeys allow-list so that the service.name baggage value set via
BaggageBuilder.OperationSource(...) is copied onto span attributes.

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.

Pull request overview

This PR fixes Agent365 tracing enrichment so that service.name set via ambient baggage (e.g., BaggageBuilder.OperationSource(...)) is actually copied onto eligible GenAI spans by ActivityProcessor, by adding OpenTelemetryConstants.ServiceNameKey to the processor’s attribute allow-list.

Changes:

  • Add OpenTelemetryConstants.ServiceNameKey to ActivityProcessor’s global AttributeKeys allow-list so baggage propagation includes service.name.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nikhilNava
Nikhil Navakiran (nikhilNava) merged commit a98bf54 into main Jun 9, 2026
10 checks passed
@nikhilNava
Nikhil Navakiran (nikhilNava) deleted the copilot/fix-pull-258-issue branch June 9, 2026 17:39
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.

5 participants