rsnext/examples/with-opentelemetry/instrumentation.ts
Jan Kaifer 1e47bc23c3
Finish up otel example with working docker and small guide in readme (#46819)
Finish up OTEL example with HTTP (we don't recommend grpc because that
package is needlessly large).

Also added a link to a simple repo with otel collector and few backends:
https://github.com/vercel/opentelemetry-collector-dev-setup

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-03-14 09:05:23 +01:00

7 lines
280 B
TypeScript

export function register() {
// We need to make sure that we import these files only in Node.js environment.
// OpenTelemetry is **not** supported on Edge or Client side at the moment.
if (process.env.NEXT_RUNTIME === 'nodejs') {
require('./instrumentation-node')
}
}