Skip to content

Prisma not tracking spans with Sentry Node.js integration #10680

Closed
@SheaBelsky

Description

@SheaBelsky

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

Framework Version

Node 18.18.2
Prisma 5.9.1

Link to Sentry event

https://mentra-ec.sentry.io/discover/leto:f128265a11dc4a19aa16092121985b6d/?field=title&field=event.type&field=project&field=user.display&field=timestamp&field=replayId&name=All+Events&project=6509483&query=&sort=-timestamp&statsPeriod=7d&yAxis=count%28%29

SDK Setup

import { extraErrorDataIntegration } from "@sentry/integrations";
import { IS_AZURE_PRODUCTION, IS_STAGING } from "./constants";
import { ProfilingIntegration } from "@sentry/profiling-node";
import { SENTRY_DSN } from "../models/sentry/data";
import * as Sentry from "@sentry/node";
import prisma from "../client";

type CaptureContext = Parameters<typeof Sentry.captureException>[1];

if (IS_AZURE_PRODUCTION || IS_STAGING) {
  Sentry.init({
    debug: true,
    dsn: SENTRY_DSN,
    environment: IS_AZURE_PRODUCTION ? "production" : "staging",
    integrations: [
      new ProfilingIntegration(),
      extraErrorDataIntegration({
        depth: 4
      }),
      Sentry.anrIntegration({ captureStackTrace: true }),
      Sentry.consoleIntegration(),
      new Sentry.Integrations.GraphQL(),
      new Sentry.Integrations.Prisma({ client: prisma })
    ],
    profilesSampleRate: 1.0,
    tracesSampleRate: 1.0
  });
  console.log(`🔦 Sentry initialized`);
}

Steps to Reproduce

  1. Set up the Prisma integration with Sentry as per the setup guide (https://docs.sentry.io/platforms/node/performance/database/opt-in/#prisma-orm-integration)
  2. Execute an operation that makes a call to Prisma and records the span to Sentry

Expected Result

I should see information about the Prisma operation in the recorded Sentry span

Actual Result

I do not see anything about Prisma in the recorded Sentry span. In this case, Prisma executes before the http.client call in the below picture.

Screenshot 2024-02-15 at 10 37 27 AM

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