File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
packages/node/src/integrations/tracing Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,12 @@ class SentryPrismaInteropInstrumentation extends PrismaInstrumentation {
7979 ) => {
8080 const tracer = trace . getTracer ( 'prismaV5Compatibility' ) as TracerWithIdGenerator ;
8181
82+ // Prisma v5 relies on being able to create spans with a specific span & trace ID
83+ // this is no longer possible in OTEL v2, there is no public API to do this anymore
84+ // So in order to kind of hack this possibility, we rely on the internal `_idGenerator` property
85+ // This is used to generate the random IDs, and we overwrite this temporarily to generate static IDs
86+ // This is flawed and may not work, e.g. if the code is bundled and the private property is renamed
87+ // in such cases, these spans will not be captured and some Prisma spans will be missing
8288 const initialIdGenerator = tracer . _idGenerator ;
8389
8490 if ( ! initialIdGenerator ) {
You can’t perform that action at this time.
0 commit comments