I’m working on implementing custom OpenTelemetry instrumentation to capture traces in our Next.js application.
This setup works as expected in a local standalone Next.js environment—I’m able to generate and view traces successfully.
However, when deploying the same setup to Vercel, which uses a serverless architecture, the custom traces do not appear in the logs as expected.
As a comparison, I experimented with the @vercel/otel
package. Using Vercel’s default telemetry setup, I was able to see traces show up correctly in the Vercel logs dashboard.
From my investigation, it seems that Vercel uses a custom telemetry implementation, including components like VercelRuntimeSpanExporter
and VercelRuntimePropagator
.
To match this behavior, I tried replicating these components in my own instrumentation library. However, despite this, my custom traces are still not being linked or displayed in Vercel’s logs dashboard.
What I’m trying to achieve:
I want my custom traces—created using OpenTelemetry—to be properly captured, linked, and displayed in the Vercel logs dashboard, just like the ones captured by Vercel’s built-in telemetry.