From 74565b93afcc943bb5c1ef7883c2f6f46e188f28 Mon Sep 17 00:00:00 2001 From: Thomas Hallock Date: Sat, 24 Jan 2026 16:57:05 -0600 Subject: [PATCH] fix(tracing): use resourceFromAttributes for OTel SDK 2.x compatibility @opentelemetry/resources v2.x changed the API - Resource class constructor was replaced with resourceFromAttributes() factory function. Co-Authored-By: Claude Opus 4.5 --- apps/web/instrumentation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/instrumentation.js b/apps/web/instrumentation.js index ad6510d8..cb705a6b 100644 --- a/apps/web/instrumentation.js +++ b/apps/web/instrumentation.js @@ -18,7 +18,7 @@ if (isEnabled) { const { NodeSDK } = require('@opentelemetry/sdk-node') const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node') const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-grpc') - const { Resource } = require('@opentelemetry/resources') + const { resourceFromAttributes } = require('@opentelemetry/resources') const { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION, @@ -33,7 +33,7 @@ if (isEnabled) { console.log(`[Tracing] Initializing OpenTelemetry - endpoint: ${endpoint}, service: ${serviceName}, pod: ${podName}`) - const resource = new Resource({ + const resource = resourceFromAttributes({ [ATTR_SERVICE_NAME]: serviceName, [ATTR_SERVICE_VERSION]: serviceVersion, [ATTR_DEPLOYMENT_ENVIRONMENT_NAME]: environment,