next.js/test/e2e/app-dir/cache-components-allow-otel-spans/instrumentation.node.ts
instrumentation.node.ts17 lines589 B
import { NodeSDK } from '@opentelemetry/sdk-node'
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http'
import { ExpressInstrumentation } from '@opentelemetry/instrumentation-express'

const sdk = new NodeSDK({
  serviceName: 'nextjs-otel-app',
  traceExporter: new OTLPTraceExporter({
    url:
      process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT ||
      'http://localhost:4318/v1/traces',
  }),
  instrumentations: [new HttpInstrumentation(), new ExpressInstrumentation()],
})

sdk.start()
Quest for Codev2.0.0
/
SIGN IN