Skip to content

Commit

Permalink
In Next.js the instrumentation.ts file needed to be in src if it exis… (
Browse files Browse the repository at this point in the history
#1157)

* In Next.js the instrumentation.ts file needed to be in src if it exists https://vercel.com/docs/observability/otel-overview

* fix formatting of src
  • Loading branch information
MariadeAnton authored Dec 19, 2024
1 parent d3fdb46 commit ba1882b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit ba1882b

Please sign in to comment.