Skip to content

Child span/transaction name replaced by Lambda function name #13391

@mstuercke

Description

@mstuercke

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/aws-serverless

SDK Version

8.26.0

Framework Version

No response

Link to Sentry event

https://mstuercke.sentry.io/performance/trace/7b533ed86b30290955b43e8b10513c5d/?node=txn-0e0841f1cf3b40a581c8cb50bc1736a9&node=txn-8b8c36aab7304b0e94d50cd767c1a2eb&pageEnd&pageStart&project=4507512062017616&source=traces&statsPeriod=5m&timestamp=1723726598.892

Reproduction Example/SDK Setup

Sentry.init({
  dsn: '<DSN>',
  tracesSampleRate: 1.0,
  environment: 'dev',
})

export const lambdaHandler = Sentry.wrapHandler(() => {
  return Sentry.startSpan({op: `foo-op`, name: 'foo-name', forceTransaction: true}, () => {
    // ...
  })
})

Steps to Reproduce

Just execute the code

Additional information:
The renaming happens here:

function enhanceScopeWithTransactionData(scope: Scope, context: Context): void {
scope.addEventProcessor(event => {
event.transaction = context.functionName;
return event;
});
scope.setTag('server_name', process.env._AWS_XRAY_DAEMON_ADDRESS || process.env.SENTRY_NAME || hostname());
scope.setTag('url', `awslambda:///${context.functionName}`);
}

Expected Result

The span should keep the name foo-name

Actual Result

The span name is replaced with the name of the lambda function. The op is untouched.

Metadata

Metadata

Assignees

Labels

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions