Instrumentation error in production - TypeError: parentTracer.getSpanLimits is not a function
See original GitHub issueBug description
I am attempting to connect to honeycomb.io
with the new Prisma Telemetry options. In a dev environment this works just fine. But in production, I receive the following error:
TypeError: parentTracer.getSpanLimits is not a function
at new Span (/build/node_modules/@prisma/client/runtime/index.js:21694:37)
at /build/node_modules/@prisma/client/runtime/index.js:23527:18
at Array.forEach (<anonymous>)
at createSpan (/build/node_modules/@prisma/client/runtime/index.js:23511:25)
at runMicrotasks (<anonymous>)
at runNextTicks (node:internal/process/task_queues:61:5)
at listOnTimeout (node:internal/timers:528:9)
at processTimers (node:internal/timers:502:7)
How to reproduce
My code (after following these instructions: https://www.prisma.io/docs/concepts/components/prisma-client/opentelemetry-tracing#register-tracing-in-your-application)
import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-proto";
import { PrismaInstrumentation } from "@prisma/instrumentation";
import { registerInstrumentations } from "@opentelemetry/instrumentation";
import { Resource } from "@opentelemetry/resources";
import { SemanticResourceAttributes } from "@opentelemetry/semantic-conventions";
import { SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base";
function setupTelemetry() {
if (process.env.NODE_ENV !== "production") {
return;
}
const provider = new NodeTracerProvider({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: "SERVICE_NAME"
})
});
// Setup how spans are processed and exported. In this case we're sending spans
// as we receive them to an OTLP-compatible collector (e.g. Jaeger).
provider.addSpanProcessor(new SimpleSpanProcessor(new OTLPTraceExporter()));
// Register your auto-instrumentors
registerInstrumentations({
instrumentations: [new PrismaInstrumentation()],
tracerProvider: provider
});
provider.register();
// eslint-disable-next-line no-console
console.log("📈 Telemetry set up");
}
export default setupTelemetry;
I then import setupTelemetry
at the entrypoint for my application and execute it:
import setupTelemetry from './server/telemetry.ts';
// ....
setupTelemetry();
Expected behavior
In a production environment, I should not receive an error AND I should receive telemetry data to Honeycomb. Right now, I get the aforementioned error and receive no telemetry data.
In a development (local) environment, everything behaves as expected.
Prisma information
Packages:
"@prisma/client": "4.2.1",
"@prisma/instrumentation": "4.2.1",
"prisma": "4.2.1",
Environment & setup
- OS: macOS (local) and Linux (Azure App Services)
- Database: Azure PostgreSQL DB
- Node.js version: v16.14.2 (locally and in Azure)
Prisma Version
prisma : 4.2.1
@prisma/client : 4.2.1
Current platform : darwin-arm64
Query Engine (Node-API) : libquery-engine 2920a97877e12e055c1333079b8d19cee7f33826 (at node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Migration Engine : migration-engine-cli 2920a97877e12e055c1333079b8d19cee7f33826 (at node_modules/@prisma/engines/migration-engine-darwin-arm64)
Introspection Engine : introspection-core 2920a97877e12e055c1333079b8d19cee7f33826 (at node_modules/@prisma/engines/introspection-engine-darwin-arm64)
Format Binary : prisma-fmt 2920a97877e12e055c1333079b8d19cee7f33826 (at node_modules/@prisma/engines/prisma-fmt-darwin-arm64)
Default Engines Hash : 2920a97877e12e055c1333079b8d19cee7f33826
Studio : 0.469.0
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:20 (9 by maintainers)
Top Results From Across the Web
instrumentation error on Fastify version 4 · Issue #2118 - GitHub
any request return an error 500 with erro message: '"next is not a function". Steps to reproduce add import import '.
Read more >Uncaught TypeError | Is Not A Function | Solution - YouTube
Have you encountered an error like:- Uncaught TypeError - Some selector is not a function - jQuery is not a function - owlCarousel...
Read more >Node.js Custom Instrumentation - Datadog Docs
Synchronous code can be traced with tracer.trace() which will automatically finish the span when its callback returns and capture any thrown error automatically ......
Read more >Measurement Error - SERC - Carleton
Anytime data is presented in class, not only in an instrumentation course, it is important they understand the errors associated with that ...
Read more >Uncaught TypeError: state.productDetails is not a function
As the error suggests. state.productDetails is not a function. This is because productDetails is a reducer object and Not a function created ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here’s a minimal representation of this error where I can reproduce the error:
https://github.com/SheaBelsky/prisma-instrumentation-test
Using the following Azure Services:
In this minimal environment locally, I can get Honeycomb data to work. But in production (Docker), I cannot and I get the following error:
Thank you for trying this, we are looking into it.