Skip to content

Fix OpenTelemetry setup #310

Description

@Taucher2003

Serverside OTel

When enabling serverside OTel, no pages load and throw this error instead:

Error: An error occurred while loading instrumentation hook: A Node.js API is used (process.cpuUsage) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime
    at <unknown> (.next/server/edge/chunks/_1005wp_._.js:8:76503)
    at Module.register (.next/server/edge/chunks/_1005wp_._.js:8:76808)
    at s (.next/server/edge/chunks/[root-of-the-server]__0g2.ana._.js:1:64811)
    at async tw (.next/server/edge/chunks/[root-of-the-server]__0g2.ana._.js:9:31563)

Clientside OTel

The clientside OTel setup uses NEXT_PUBLIC_* environment variables. These variables are inlined during build time and are not configurable at runtime. This needs to be changed to a solution that can be configured at runtime.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

System

IDE

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions