[aws-xray] Update SamplerRulesApplier to recognize new HTTP/URL semconv. #1959
Merged
trask merged 14 commits intoopen-telemetry:mainfrom Jul 23, 2025
Merged
[aws-xray] Update SamplerRulesApplier to recognize new HTTP/URL semconv. #1959trask merged 14 commits intoopen-telemetry:mainfrom
trask merged 14 commits intoopen-telemetry:mainfrom
Conversation
laurit
reviewed
Jun 12, 2025
| if (entry.getKey().equals(HTTP_TARGET) || entry.getKey().equals(UrlAttributes.URL_PATH)) { | ||
| httpTarget = (String) entry.getValue(); | ||
| } else if (entry.getKey().equals(HTTP_URL)) { | ||
| } else if (entry.getKey().equals(HTTP_URL) || entry.getKey().equals(UrlAttributes.URL_FULL)) { |
Contributor
There was a problem hiding this comment.
server instrumentations don't fill url.full, would that be an issue?
Contributor
Author
There was a problem hiding this comment.
That should be fine. It's there incase URL_PATH isn't being populated and the idea here is to then extract the path from URL_FULL.
laurit
reviewed
Jun 12, 2025
laurit
reviewed
Jun 12, 2025
Contributor
|
🔧 The result from spotlessApply was committed to the PR branch. |
laurit
reviewed
Jul 14, 2025
Contributor
|
🔧 The result from spotlessApply was committed to the PR branch. |
srprash
approved these changes
Jul 16, 2025
laurit
reviewed
Jul 21, 2025
laurit
reviewed
Jul 21, 2025
laurit
reviewed
Jul 21, 2025
Contributor
|
🔧 The result from spotlessApply was committed to the PR branch. |
laurit
approved these changes
Jul 23, 2025
mcmho
reviewed
Jul 26, 2025
Contributor
mcmho
left a comment
There was a problem hiding this comment.
i ran the test. and also, lgtm.
lukeina2z
added a commit
to aws-observability/aws-otel-java-instrumentation
that referenced
this pull request
Aug 22, 2025
…8.0 (#1156) This updates upstream dependency OTel Java Agent to v2.18.1 and upgrades upstream OTel Contrib to v1.48.0. It removes two patch files, as those code has been migrated to upstream. For the OTel Java Contrib patch, it has been replaced by PR-1959 open-telemetry/opentelemetry-java-contrib#1959 , which is included in the OTel Java Contrib v1.48.0 release. For the OTel Java Agent patch for the Lambda stream handler, it has been replaced by PR-13466 open-telemetry/opentelemetry-java-instrumentation#13466 , which is included in the OTel Java Agent v2.18.1 release. Tests: - Unit tests pass: ./gradlew build test - Smoke/Contract tests pass: ./gradlew appsignals-tests:contract-tests:contractTests - X-Ray remote sampling service end-to-end manual tests pass - EC2 end-to-end tests with SpringBoot Java app pass - Lambda end-to-end tests with SpringBoot Java app pass By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
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.
Description:
The HTTP/URL semantic conventions were updated making the X-Ray Sampler outdated since it only recognizes the older HTTP semantic conventions. I've updated the SamplingRuleApplier to look at both the old and new conventions for backwards compatibility.
Testing:
Updated unit tests and are now passing.
Manual Testing:
For the manual testing. I created three sampling rules in the X-Ray console
/aws-sdk-callwith 100% sampling/outgoing-http-callwith 100% samplingI used a sample app with two APIs:
Before the change, calling any of the above APIs wasn't being matched when it should. After the change, the rules were being matched and each rule showed the correct stats.
Before the change:

After the change:
