From 1d9f10f83cb48c16abf067393a0d59ed3a3017b4 Mon Sep 17 00:00:00 2001 From: MariadeAnton Date: Thu, 19 Dec 2024 16:47:05 +0100 Subject: [PATCH 1/2] In Next.js the instrumentation.ts file needed to be in src if it exists https://vercel.com/docs/observability/otel-overview --- .../docs/traces-open-telemetry/instrumenting-code/nextjs.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site/content/docs/traces-open-telemetry/instrumenting-code/nextjs.md b/site/content/docs/traces-open-telemetry/instrumenting-code/nextjs.md index 5b8eda523..3267267ee 100644 --- a/site/content/docs/traces-open-telemetry/instrumenting-code/nextjs.md +++ b/site/content/docs/traces-open-telemetry/instrumenting-code/nextjs.md @@ -48,7 +48,8 @@ const nextConfig = { module.exports = nextConfig ``` -Create a file called `instrumentation.ts` at the root of your project and add the following code: +Create an `instrumentation.ts` file in the root of your project, or, place in the src directory if you are using one. +And add the following code: ```ts {title="instrumentation.ts"} import { registerOTel } from '@vercel/otel' From ec6aee4757b9274ab03eb56fde74affaebe491c4 Mon Sep 17 00:00:00 2001 From: MariadeAnton Date: Thu, 19 Dec 2024 17:55:10 +0100 Subject: [PATCH 2/2] fix formatting of src --- .../docs/traces-open-telemetry/instrumenting-code/nextjs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/content/docs/traces-open-telemetry/instrumenting-code/nextjs.md b/site/content/docs/traces-open-telemetry/instrumenting-code/nextjs.md index 3267267ee..965cfb663 100644 --- a/site/content/docs/traces-open-telemetry/instrumenting-code/nextjs.md +++ b/site/content/docs/traces-open-telemetry/instrumenting-code/nextjs.md @@ -48,7 +48,7 @@ const nextConfig = { module.exports = nextConfig ``` -Create an `instrumentation.ts` file in the root of your project, or, place in the src directory if you are using one. +Create an `instrumentation.ts` file in the root of your project, or, place in the `src` directory if you are using one. And add the following code: ```ts {title="instrumentation.ts"}