Skip to content

Keep transaction name in error event with request data extension #11025

Closed
@jeengbe

Description

@jeengbe

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

7.106.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

Sentry.initSentry({
  // ...
    new Sentry.Integrations.RequestData({})
})

Steps to Reproduce

  1. Start transaction
  2. Rename transaction Sentry.getActiveSpan()?.updateName("a");
  3. Set Sentry.getCurrentScope().setSDKProcessingMetadata({ request: ctx.request }); from koa request
  4. Sentry.captureException(new Error())

Expected Result

I expect error events created in the transaction to inherit the transaction name from the span/transaction (not sure what the difference is with recent deprecations). Instead, the RequestData integration overwrites the transaction name from the currently active transaction.

I see there is a check in

if (include.transaction && !event.transaction) {
that tries !event.transasction, but that property is not set on that event. Instead, there's a tags.transaction tag.

Actual Result

See above.


The workaround of setting:

    new Sentry.Integrations.RequestData({
      // @ts-expect-error
      transactionNamingScheme: false,
    }),

seems to work (I assume transaction linking is done in the backend?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: nodeIssues related to the Sentry Node SDK

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions