Vercel APM - Setup & Installation Docs | Middleware
Traces | Metrics | App Logs | Custom Logs | Profiling |
---|---|---|---|---|
✅ | ✖️ | ✅ | ✅ | ✅ |
Vercel Account
Next.js Version
Next.js version 13.4
or above. Check your Next.js version with the following command:OpenTelemetry Package
@opentelemetry/api
package installed. If not, run the following command:Value | Details |
---|---|
Static | Collects logs for static assets like HTML and CSS files |
Edge | Outputs log data from Edge Functions like Middleware |
Lambda | Outputs log data from Vercel Functions like API Routes |
External | Collects log results for external rewrites to a different domain |
Build | Outputs log data from the Build Step |
Next.js
APM Packagenext.config.js
file:
instrumentation.ts (or .js)
Fileinstrumentation.ts (or .js)
file in your project root directory or inside the src folder
instrumentation.ts
file must be located at the root
of your project unless you are using the src
directory. If you are using the src
directory, ensure the instrumentation.ts
file is placed within the src
directory, alongside the pages and app directories.pagesExtension
config option to add suffixes
instrumentation.ts
instrumentation.ts
file will not be invoked, resulting in the absence of traces or logs in your Middleware account.
npx create-next-app@latest --example api-routes