import { registerOTel } from "@vercel/otel"; import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http"; const ingestKey = process.env.CORRIDORA_INGEST_KEY; if (!ingestKey) throw new Error("Missing CORRIDORA_INGEST_KEY"); registerOTel({ serviceName: "shop-api-vercel", attributes: { "service.namespace": "commerce", "deployment.environment.name": process.env.VERCEL_ENV ?? "development", "service.version": process.env.VERCEL_GIT_COMMIT_SHA ?? "local", }, traceExporter: new OTLPTraceExporter({ url: "https://ingest.corridora.ai/v1/traces", headers: { "X-CORRIDORA-KEY": ingestKey }, }), instrumentationConfig: { fetch: { propagateContextUrls: [/^https:\/\/api\.example\.com(?:\/|$)/], }, }, });