Skip to content
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

CustomSamplingContext is not passed to profilesSampler callback #13705

Open
3 tasks done
voho opened this issue Sep 17, 2024 · 1 comment
Open
3 tasks done

CustomSamplingContext is not passed to profilesSampler callback #13705

voho opened this issue Sep 17, 2024 · 1 comment
Labels
Package: node Issues related to the Sentry Node SDK

Comments

@voho
Copy link

voho commented Sep 17, 2024

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.119.0

Framework Version

7.119.0

Link to Sentry event

No response

Reproduction Example/SDK Setup

Sentry.init({
    dsn: SENTRY_DSN,
    attachStacktrace: true,
    includeLocalVariables: true,
    release: VERSION,
    tracesSampler: ctx => {
        console.log("tracesSampler ctx", ctx.custom)
        return 0
    },
    profilesSampler: ctx => {
        console.log("profilesSampler ctx", ctx.custom)
        return 0
    },
    integrations: [
        new Sentry.Integrations.LocalVariables({
            captureAllExceptions: true,
        }),
        new Sentry.Integrations.ContextLines({
            frameContextLines: 12, // Default is 7
        }),
        new Sentry.Integrations.Http({
            tracing: true,
        }),
        // Enable node profiling
        nodeProfilingIntegration(),
    ],
})

Steps to Reproduce

  1. Initialize Sentry with tracesSampler and profilesSampler callbacks.
  2. Send custom context when starting transaction (startTransaction).
  3. Get custom context in the profilesSampler callback.
const transaction = Sentry.getCurrentHub().startTransaction({ name: `XXX` }, { custom: 'XXX' }) as
    | Sentry.Transaction
    | undefined

Expected Result

Custom context is passed.

Actual Result

Custom context is not passed.

@github-actions github-actions bot added the Package: node Issues related to the Sentry Node SDK label Sep 17, 2024
@voho voho changed the title CustomSamplingContext is passed to tracesSampler, but not to profilesSampler callback CustomSamplingContext is not passed to profilesSampler callback Sep 17, 2024
@andreiborza
Copy link
Member

Hello @voho, thanks for writing in. We'll take a look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: node Issues related to the Sentry Node SDK
Projects
Status: No status
Development

No branches or pull requests

2 participants