-
Notifications
You must be signed in to change notification settings - Fork 604
chore(sampler-aws-xray): update semconv usage to modern exports #3076
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
chore(sampler-aws-xray): update semconv usage to modern exports #3076
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3076 +/- ##
==========================================
- Coverage 92.67% 92.67% -0.01%
==========================================
Files 237 237
Lines 11247 11246 -1
Branches 2334 2333 -1
==========================================
- Hits 10423 10422 -1
Misses 824 824
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
// XXX can we drop this? (else replace it with semconv-obsolete.ts usage) | ||
SEMRESATTRS_FAAS_ID, |
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.
@jj22ee Hi. I have a question about the faas.id
usage here.
Background: I've been working on removing all of the usages of the old/deprecated exports from the @opentelemetry/semantic-conventions
package, which includes all of the SEMRESATTRS_*
exports -- as part of #2377.
This usage is one of the last ones.
faas.id
was replaced with cloud.resource_id
in SemConv 1.19 in 2023: https://github.com/open-telemetry/semantic-conventions/blob/main/CHANGELOG.md#v1190-2023-03-06
What is an expected case where getLambdaArn()
(below) will encounter a resource with the faas.id
attribute? I'm not challenging, just trying to understand how this sampler would be used.
instrumentation-aws-lambda
does still use the old faas.id
(
opentelemetry-js-contrib/packages/instrumentation-aws-lambda/src/instrumentation.ts
Lines 233 to 239 in febf30e
const span = plugin.tracer.startSpan( | |
name, | |
{ | |
kind: SpanKind.SERVER, | |
attributes: { | |
[ATTR_FAAS_EXECUTION]: context.awsRequestId, | |
[ATTR_FAAS_ID]: context.invokedFunctionArn, |
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.
TLDR: SEMRESATTRS_FAAS_ID
can be dropped, doesn't change the experience for users of X-Ray Sampler.
Today there isn't an expected case where getLambdaArn()
would encounter a resource with faas.id
because lambda instrumentation or resource-detector doesn't set it, and even if they did, it doesn't matter for X-Ray Sampler today because:
-
One of the requirements for a Sampling Rule to be used in X-Ray Sampler is if that Sampling Rule's Resource ARN matches matches the ARN extracted from the resource attributes, which could include
getLambdaArn()
.- Today, all Sampling Rule's Resource ARN is hardcoded to be the
*
match-all wildcard, and cannot be configured by the user (except for Sampling Rules used for AWS APIGW).
https://docs.aws.amazon.com/xray/latest/devguide/xray-console-sampling.html#xray-console-sampling-options
- Today, all Sampling Rule's Resource ARN is hardcoded to be the
So effectively, the result of getLambdaArn()
doesn't change anything, as all sampling rules will match its result because of the *
wildcard match. The check for faas.id
in getLambdaArn()
was intended for future-proofing in case X-Ray does want to support letting users match Sampling Rule's Resource ARN to getLambdaArn()
.
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.
dropped in commit 9d0f303
Refs: #2377
Checklist