P
Prisma•5mo ago
Max

Otel integration

I am trying to set up otel with the @prisma/instrumentation package. Unfortunately, i am running in the following issue:
2 Replies
Max
MaxOP•5mo ago
web:dev: prisma:query SELECT "t1"."domain", "t1"."created_at" AS "createdAt", "t1"."updated_at" AS "updatedAt", "t1"."auth_provider" AS "authProvider", "t1"."auth_config" AS "authConfig" FROM "public"."sso_configs" AS "t1"
web:dev: TypeError: parentTracer.getSpanLimits is not a function
web:dev: at new Span (webpack-internal:///(instrument)/../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@opentelemetry/sdk-trace-base/build/esm/Span.js:104:41)
web:dev: at eval (webpack-internal:///(instrument)/../node_modules/.pnpm/@[email protected]/node_modules/@prisma/instrumentation/dist/chunk-VVAFFO6L.js:59:20)
web:dev: at Array.forEach (<anonymous>)
web:dev: at ActiveTracingHelper.createEngineSpan (webpack-internal:///(instrument)/../node_modules/.pnpm/@[email protected]/node_modules/@prisma/instrumentation/dist/chunk-VVAFFO6L.js:44:27)
web:dev: at eo.createEngineSpan (webpack-internal:///(api)/../node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:122:1645)

[...]

/node_modules/@prisma/instrumentation/dist/chunk-VVAFFO6L.js:44:27)
web:dev: at eo.createEngineSpan (webpack-internal:///(api)/../node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:122:1645)
web:dev: at wt.logger (webpack-internal:///(api)/../node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:112:1167)
web:dev: at eval (webpack-internal:///(api)/../node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:112:922)
web:dev: prisma:query SELECT "t1"."domain", "t1"."created_at" AS "createdAt", "t1"."updated_at" AS "updatedAt", "t1"."auth_provider" AS "authProvider", "t1"."auth_config" AS "authConfig" FROM "public"."sso_configs" AS "t1"
web:dev: TypeError: parentTracer.getSpanLimits is not a function
web:dev: at new Span (webpack-internal:///(instrument)/../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@opentelemetry/sdk-trace-base/build/esm/Span.js:104:41)
web:dev: at eval (webpack-internal:///(instrument)/../node_modules/.pnpm/@[email protected]/node_modules/@prisma/instrumentation/dist/chunk-VVAFFO6L.js:59:20)
web:dev: at Array.forEach (<anonymous>)
web:dev: at ActiveTracingHelper.createEngineSpan (webpack-internal:///(instrument)/../node_modules/.pnpm/@[email protected]/node_modules/@prisma/instrumentation/dist/chunk-VVAFFO6L.js:44:27)
web:dev: at eo.createEngineSpan (webpack-internal:///(api)/../node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:122:1645)

[...]

/node_modules/@prisma/instrumentation/dist/chunk-VVAFFO6L.js:44:27)
web:dev: at eo.createEngineSpan (webpack-internal:///(api)/../node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:122:1645)
web:dev: at wt.logger (webpack-internal:///(api)/../node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:112:1167)
web:dev: at eval (webpack-internal:///(api)/../node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:112:922)
I installed otel like this in the nextjs instrumentation.ts file:
const sdk = new NodeSDK({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: "your-project-name",
// NOTE: You can replace `your-project-name` with the actual name of your project
}),
spanProcessor: new SimpleSpanProcessor(new ConsoleSpanExporter()),
instrumentations: [
new IORedisInstrumentation(),
new HttpInstrumentation(),
getNodeAutoInstrumentations(),
new PrismaInstrumentation(),
],
});

sdk.start();
const sdk = new NodeSDK({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: "your-project-name",
// NOTE: You can replace `your-project-name` with the actual name of your project
}),
spanProcessor: new SimpleSpanProcessor(new ConsoleSpanExporter()),
instrumentations: [
new IORedisInstrumentation(),
new HttpInstrumentation(),
getNodeAutoInstrumentations(),
new PrismaInstrumentation(),
],
});

sdk.start();
Here are the installed packages:
"@opentelemetry/api": "^1.8.0",
"@opentelemetry/auto-instrumentations-node": "^0.49.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.52.1",
"@opentelemetry/instrumentation": "^0.52.1",
"@opentelemetry/instrumentation-http": "^0.52.1",
"@opentelemetry/instrumentation-ioredis": "^0.42.0",
"@opentelemetry/instrumentation-pino": "^0.41.0",
"@opentelemetry/resources": "^1.25.1",
"@opentelemetry/sdk-node": "^0.52.1",
"@opentelemetry/sdk-trace-base": "^1.25.1",
"@opentelemetry/sdk-trace-node": "^1.25.1",
"@opentelemetry/semantic-conventions": "^1.25.1",
"@opentelemetry/winston-transport": "^0.5.0",
"@prisma/instrumentation": "^5.17.0",
"@opentelemetry/api": "^1.8.0",
"@opentelemetry/auto-instrumentations-node": "^0.49.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.52.1",
"@opentelemetry/instrumentation": "^0.52.1",
"@opentelemetry/instrumentation-http": "^0.52.1",
"@opentelemetry/instrumentation-ioredis": "^0.42.0",
"@opentelemetry/instrumentation-pino": "^0.41.0",
"@opentelemetry/resources": "^1.25.1",
"@opentelemetry/sdk-node": "^0.52.1",
"@opentelemetry/sdk-trace-base": "^1.25.1",
"@opentelemetry/sdk-trace-node": "^1.25.1",
"@opentelemetry/semantic-conventions": "^1.25.1",
"@opentelemetry/winston-transport": "^0.5.0",
"@prisma/instrumentation": "^5.17.0",
Is this a known issue? What can i do about that?
Nurul
Nurul•5mo ago
Hey Max 👋 We do have a related GitHub Issue here: https://github.com/prisma/prisma/issues/21397 Does any of the solutions mentioned in the issue work for you?
GitHub
parentTracer.getSpanLimits is not a function · Issue #21397 · pri...
Bug description Upgrading to Prisma v5.4.1 caused the following error to appear TypeError: parentTracer.getSpanLimits is not a function at new Span (/var/task/node_modules/@prisma/instrumentation/n...
Want results from more Discord servers?
Add your server