Insturmentation.ts for otel/tracing

I’m trying to follow vercel’s docs to enable opentelemetry on a NON-NEXTJS node project (SvelteKit), where i’ve insturmented my application manually.

All the docs say “just throw an insturmentation.ts file in the root of your project and we’ll handle the rest” but nowhere in the build or svelte adapter build does this happen!

So, can i even inject insturmentation.ts (or .js) in the vercel build output somehow?

I’ve been banging my head for days on this.

Hey @zyther! It looks like you have spelling error in the file name. It should be instrumentation.ts. If you change the file name, does that work for you?

Don’t forget to create spans for each request since it’s not a Next.js project. The start tracing requests in your project step has some example code in case you need it. You can click over to the Other Frameworks tab to see it.

1 Like

Omfg. Thank you. I’ll try this.

Good lord thanks. XD

I come back to report that this did not solve the problem. I should be seeing smaller dns, tls, and http traces even if they’re not attached to a root span.

I see no telemetry coming in at all, nor do i see my application logging any otel messages when i deploy to vercel. (middleware.io)

I also know my instrumentation.ts file works if i import it directly

I have an instrumentation.ts, js in both root and src, and vercel still doesnt want to see it.
I could try placing it right in the output directory, but now i feel im doing too much for what the feature says it should do.