-
Notifications
You must be signed in to change notification settings - Fork 157
[aws-xray] Update SamplerRulesApplier to recognize new HTTP/URL semconv. #1959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,8 @@ | |
import io.opentelemetry.sdk.trace.samplers.Sampler; | ||
import io.opentelemetry.sdk.trace.samplers.SamplingDecision; | ||
import io.opentelemetry.sdk.trace.samplers.SamplingResult; | ||
import io.opentelemetry.semconv.HttpAttributes; | ||
import io.opentelemetry.semconv.UrlAttributes; | ||
import java.time.Duration; | ||
import java.util.Collections; | ||
import java.util.Date; | ||
|
@@ -181,11 +183,12 @@ boolean matches(Attributes attributes, Resource resource) { | |
String host = null; | ||
|
||
for (Map.Entry<AttributeKey<?>, Object> entry : attributes.asMap().entrySet()) { | ||
if (entry.getKey().equals(HTTP_TARGET)) { | ||
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)) { | ||
httpUrl = (String) entry.getValue(); | ||
} else if (entry.getKey().equals(HTTP_METHOD)) { | ||
} else if (entry.getKey().equals(HTTP_METHOD) | ||
|| entry.getKey().equals(HttpAttributes.HTTP_REQUEST_METHOD)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there is also |
||
httpMethod = (String) entry.getValue(); | ||
} else if (entry.getKey().equals(NET_HOST_NAME)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
host = (String) entry.getValue(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
server instrumentations don't fill
url.full
, would that be an issue?