Skip to content

[exporter/awsxrayexporter] fix messaging system logic#42633

Merged
mx-psi merged 9 commits into
open-telemetry:mainfrom
ezhang6811:zhaez/producer-span-namespace
Oct 6, 2025
Merged

[exporter/awsxrayexporter] fix messaging system logic#42633
mx-psi merged 9 commits into
open-telemetry:mainfrom
ezhang6811:zhaez/producer-span-namespace

Conversation

@ezhang6811
Copy link
Copy Markdown
Contributor

Description

Set namespace="remote" for producer spans so that X-ray will infer a downstream service node. Changed consumer spans to be segments so that they can correlate to their own node while being downstream from the producer.

Link to tracking issue

Fixes #40995

Testing

Added unit tests for producer span and updated unit tests for consumer spans.

@ezhang6811 ezhang6811 requested a review from a team as a code owner September 11, 2025 00:24
@github-actions
Copy link
Copy Markdown
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better!

@github-actions github-actions Bot added first-time contributor PRs made by new contributors exporter/awsxray labels Sep 11, 2025
Copy link
Copy Markdown
Contributor

@wangzlei wangzlei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
literally, consumer span is the local root span, should be translated to xray Segment instead of Subsegment.

@github-actions
Copy link
Copy Markdown
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better!

@wangzlei
Copy link
Copy Markdown
Contributor

@TylerHelmuth Please help merge the PR, thanks!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 3, 2025

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions Bot added the Stale label Oct 3, 2025
@mx-psi mx-psi merged commit c9ce64b into open-telemetry:main Oct 6, 2025
203 checks passed
@github-actions github-actions Bot added this to the next release milestone Oct 6, 2025
@otelbot
Copy link
Copy Markdown
Contributor

otelbot Bot commented Oct 6, 2025

Thank you for your contribution @ezhang6811! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

graphaelli pushed a commit to graphaelli/opentelemetry-collector-contrib that referenced this pull request Oct 6, 2025
…#42633)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Set `namespace="remote"` for producer spans so that X-ray will infer a
downstream service node. Changed consumer spans to be segments so that
they can correlate to their own node while being downstream from the
producer.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes
open-telemetry#40995

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added unit tests for producer span and updated unit tests for consumer
spans.


<!--Please delete paragraphs that you did not use before submitting.-->
thpierce pushed a commit to thpierce/opentelemetry-collector-contrib that referenced this pull request Oct 6, 2025
…#42633)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Set `namespace="remote"` for producer spans so that X-ray will infer a
downstream service node. Changed consumer spans to be segments so that
they can correlate to their own node while being downstream from the
producer.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes
open-telemetry#40995

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added unit tests for producer span and updated unit tests for consumer
spans.


<!--Please delete paragraphs that you did not use before submitting.-->
sky333999 pushed a commit to amazon-contributing/opentelemetry-collector-contrib that referenced this pull request Oct 6, 2025
mashhurs pushed a commit to mashhurs/opentelemetry-collector-contrib that referenced this pull request Oct 9, 2025
…#42633)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Set `namespace="remote"` for producer spans so that X-ray will infer a
downstream service node. Changed consumer spans to be segments so that
they can correlate to their own node while being downstream from the
producer.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes
open-telemetry#40995

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added unit tests for producer span and updated unit tests for consumer
spans.


<!--Please delete paragraphs that you did not use before submitting.-->
tommyers-elastic pushed a commit to tommyers-elastic/opentelemetry-collector-contrib that referenced this pull request Oct 10, 2025
…#42633)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Set `namespace="remote"` for producer spans so that X-ray will infer a
downstream service node. Changed consumer spans to be segments so that
they can correlate to their own node while being downstream from the
producer.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes
open-telemetry#40995

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added unit tests for producer span and updated unit tests for consumer
spans.


<!--Please delete paragraphs that you did not use before submitting.-->
ogulcanaydogan added a commit to ogulcanaydogan/opentelemetry-collector-contrib that referenced this pull request Apr 12, 2026
… segments

Before this change, an X-Ray segment produced from a Consumer span that
is a local root used the remote service name (aws.remote.service) or,
if that attribute was absent, fell back to the span (operation) name.
Server local root spans already used aws.local.service / resource
service.name. Consumer local root spans should behave the same way now
that PR open-telemetry#42633 promotes them to Segments.

Changes in MakeSegment:
1. Extend the aws.local.service attribute check to also cover Consumer
   spans that are local roots (mirrors the existing Server logic).
2. Extend the resource.service.name fallback to also cover Consumer
   local root spans when neither aws.local.service nor
   aws.remote.service is set.

Fixes open-telemetry#43432

Assisted-by: Claude Sonnet 4.6
ogulcanaydogan added a commit to ogulcanaydogan/opentelemetry-collector-contrib that referenced this pull request Apr 12, 2026
… segments

After PR open-telemetry#42633 promoted Consumer local root spans to X-Ray Segments,
the service segment naming still fell through to the span (operation)
name when aws.local.service was absent, while Server segments already
fell back to resource.service.name.

Fix is applied directly in MakeServiceSegmentForLocalRootDependencySpan
rather than in MakeSegment, so the dependency subsegment produced
alongside is unaffected regardless of whether aws.remote.service is
present.

Naming priority for the service segment (unchanged for all other paths):
1. aws.local.service attribute (existing behavior)
2. resource.service.name (new fallback, mirrors Server span behavior)
3. span name / other existing fallbacks

Fixes open-telemetry#43432

Assisted-by: Claude Sonnet 4.6
ogulcanaydogan added a commit to ogulcanaydogan/opentelemetry-collector-contrib that referenced this pull request May 1, 2026
… segments

Before this change, an X-Ray segment produced from a Consumer span that
is a local root used the remote service name (aws.remote.service) or,
if that attribute was absent, fell back to the span (operation) name.
Server local root spans already used aws.local.service / resource
service.name. Consumer local root spans should behave the same way now
that PR open-telemetry#42633 promotes them to Segments.

Changes in MakeSegment:
1. Extend the aws.local.service attribute check to also cover Consumer
   spans that are local roots (mirrors the existing Server logic).
2. Extend the resource.service.name fallback to also cover Consumer
   local root spans when neither aws.local.service nor
   aws.remote.service is set.

Fixes open-telemetry#43432

Assisted-by: Claude Sonnet 4.6
ogulcanaydogan added a commit to ogulcanaydogan/opentelemetry-collector-contrib that referenced this pull request May 1, 2026
… segments

After PR open-telemetry#42633 promoted Consumer local root spans to X-Ray Segments,
the service segment naming still fell through to the span (operation)
name when aws.local.service was absent, while Server segments already
fell back to resource.service.name.

Fix is applied directly in MakeServiceSegmentForLocalRootDependencySpan
rather than in MakeSegment, so the dependency subsegment produced
alongside is unaffected regardless of whether aws.remote.service is
present.

Naming priority for the service segment (unchanged for all other paths):
1. aws.local.service attribute (existing behavior)
2. resource.service.name (new fallback, mirrors Server span behavior)
3. span name / other existing fallbacks

Fixes open-telemetry#43432

Assisted-by: Claude Sonnet 4.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

exporter/awsxray does not set namespace remote for producer spans

4 participants