No traces on cron / api functions

Hi,

I have a Next.JS application that uses the Vercel **@vercel/otel** Opentelemetry instrumentation to send traces to honeycomb.

What I noticed is that I don’t have traces for the invocations that are happening on cron functions.

The Vercel logs show the log statements and also the external fetch calls.

In honeycomb there is only a trace with the name

“middleware GET /api/cron/catalog-observer”

from the edge function.

Also if I invoke the api route manually there is no trace for the api route.

Unfortunately it’s hard to debug this because it seems that log statements that are on “DEBUG” level seems to be omitted.
So setting the OTEL library to debug (by setting the env var OTEL_LOG_LEVEL=DEBUG) is not showing log statements.

instrumentation

import { registerOTel } from '@vercel/otel';

export async function register() {
 const instrumentations = [];
 if (process.env.NEXT_RUNTIME === 'nodejs') {
   const { AwsInstrumentation } = await import('@opentelemetry/instrumentation-aws-sdk');
   instrumentations.push(new AwsInstrumentation());
 }
 registerOTel({
   serviceName: 'reinvent-planner-2024',
   instrumentations: instrumentations,
 });
}

Thanks for reporting this. Just to confirm, are you still unable to see traces for cron function invocations?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.