Skip to content

Prisma Tracer not working on production builds #7216

Closed
@jporsay

Description

@jporsay

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using? If you use the CDN bundles, please specify the exact bundle (e.g. bundle.tracing.min.js) in your SDK setup.

@sentry/nextjs

SDK Version

7.37.2

Framework Version

13.1.1

Link to Sentry event

https://pulposapp.sentry.io/performance/pulpos-app-dev:d8283cfa1e9f4cd893e0e8cc26e59988/?project=4504339811074048&query=http.method%3AGET&referrer=performance-transaction-summary&statsPeriod=7d&transaction=GET+%2Fapi%2Ftrpc%2F%5Btrpc%5D&unselectedSeries=p100%28%29

SDK Setup

  Sentry.init({
    environment: env.NEXT_PUBLIC_APP_ENV,
    dsn: env.NEXT_PUBLIC_SENTRY_DSN,
    tracesSampleRate: 1.0,
    profilesSampleRate: 1.0,
    integrations: [
      new CaptureConsole({
        levels: ['log', 'warn', 'error', 'debug', 'assert'],
      }),
      new Tracing.Integrations.Prisma({ client: prisma }),
      new ProfilingIntegration(),
    ],
  });

Steps to Reproduce

For context, this is being run within an NX monorepo.

Steps:

  1. Build production build: nx build app (application is called app)
  2. Execute production build: nx run app:serve:production
  3. Open the application in a page that has any tRPC API call with database use.

Expected Result

Profiling contains prisma database spans.

Actual Result

No database spans are present. However the interesting thing is that if I were to execute the application in development mode, the spans are reported correctly. This issue started happening when we upgraded the following packages:

"@sentry/nextjs": "^7.28.1" -> "^7.37.2",
"@sentry/profiling-node": "^0.0.12" -> "^7.37.2",
"@sentry/replay": "^7.28.1" -> "^7.37.2",
"@sentry/tracing": "^7.28.1" -> "^7.37.2",

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions