Integrate Gentrace with Next.js applications for comprehensive AI tracing
@opentelemetry/sdk-trace-node
v1 (not v2) due
to functionality and type compatibility issues with v2.instrumentation.ts
file in your project root:
instrumentation.ts
during server
startup. No additional configuration is needed.otelSetup: false
:
otelSetup: false
in Next.js to avoid conflicts between
Gentrace’s OpenTelemetry setup and Vercel’s..env.local
:
instrumentation.ts
approach won’t work due to conflicts between Sentry’s OpenTelemetry configuration and the default setup. Sentry overrides many of the default OpenTelemetry SDK configurations, which can prevent traces from being sent to Gentrace.
openTelemetrySpanProcessors
option:
instrumentation.ts
approach and the Sentry
configuration approach simultaneously. This will cause conflicts and
may result in missing or duplicated traces.@opentelemetry/sdk-trace-base@^1
@opentelemetry/sdk-trace-base@^2