- Console Logs
- Traces
If you’re looking for session replay/browser-side monitoring, you’ll want to install the Browser integration instead.
Installing
Enable instrumentation hook (required for v15 and below)
To get started, you’ll need to enable the Next.js instrumentation hook by settingexperimental.instrumentationHook = true; in your next.config.js.
Example:
Install ClickHouse OpenTelemetry SDK
- NPM
- Yarn
Create instrumentation files
Create a file calledinstrumentation.ts (or .js) in your Next.js project root with the following contents:
Configure environment variables
If you’re sending traces directly to ClickStack via the OpenTelemetry, you’ll need to start your Next.js server with the following environment variables to point spans towards the OTel collector:- Managed ClickStack
- ClickStack Open Source
copy