feat(aws-serverless): Emit low cardinality function.aws span names - #24072
Open
Lms24 wants to merge 4 commits into
Open
feat(aws-serverless): Emit low cardinality function.aws span names#24072Lms24 wants to merge 4 commits into
function.aws span names#24072Lms24 wants to merge 4 commits into
Conversation
Contributor
size-limit report 📦
|
Lms24
force-pushed
the
lms/feat-aws-faas-span-names
branch
from
September 4, 2026 11:11
775eeab to
4939949
Compare
`function.aws` spans were already named after the Lambda function, which is what the
`{{faas.name}}` template in the Sentry span name conventions asks for, so their names do
not change. What was missing is the conventions' static fallback: when the invocation
context carries no function name, the span was started with an empty name and `faas.name`
was left unset.
Resolve the function name from `context.functionName` or the `AWS_LAMBDA_FUNCTION_NAME`
environment variable, use it for both the span name and `faas.name`, and fall back to
`Serverless function execution` under span streaming. Without span streaming the name stays
byte-identical to before.
Refs #23954
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`requestSpanOptions.test.ts` asserted the start-span options object against a mocked client. The `aws-serverless` e2e app now runs on span streaming and covers the same ground against a real Lambda, so the unit tests only duplicated it. The one branch e2e cannot reach is the `Serverless function execution` fallback: Lambda always populates `context.functionName`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ame source `function.aws` spans left `sentry.segment.name.source` unset, so it defaulted to `custom` — which claims the user named the span. The name comes from the Lambda function, so `component` is what it is, and it matches the other FaaS spans. Applies in both trace lifecycles, so the static layer suite and the streamed npm suite are updated alongside it. Refs #23954 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Lms24
force-pushed
the
lms/feat-aws-faas-span-names
branch
from
September 4, 2026 12:11
a289648 to
4e43ca6
Compare
Lms24
marked this pull request as ready for review
September 4, 2026 12:14
Lms24
requested review from
isaacs,
msonnb and
mydea
and removed request for
a team
September 4, 2026 12:14
msonnb
approved these changes
Sep 4, 2026
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.
Small adjustment: When streaming is enabled and we can't get a function name, we fall back to the string name.
Additionally, added the
sentry.segment.name.sourceattribute which was missing previously, in line with GCP, set toroute. Other than that the span name already fitted conventions, so no more changes necessary.To test, this converts the AWS Lambda test to span streaming. The other (layer one) is unchanged, to be converted later.
ref #23954