diff --git a/ui/src/hooks.server.ts b/ui/src/hooks.server.ts index 496db6a..bb4d6d7 100644 --- a/ui/src/hooks.server.ts +++ b/ui/src/hooks.server.ts @@ -9,7 +9,7 @@ import { createUserSession, touchUserSession, isSessionRevoked } from '$lib/serv import { drain as drainPresignCache } from '$lib/server/presignCache'; import { NodeSDK } from '@opentelemetry/sdk-node'; import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'; -import { Resource } from '@opentelemetry/resources'; +import { resourceFromAttributes } from '@opentelemetry/resources'; import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from '@opentelemetry/semantic-conventions'; // ─── OpenTelemetry server-side tracing ──────────────────────────────────────── @@ -17,7 +17,7 @@ import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from '@opentelemetry/semantic const otlpEndpoint = process.env.OTEL_EXPORTER_OTLP_ENDPOINT; if (otlpEndpoint) { const sdk = new NodeSDK({ - resource: new Resource({ + resource: resourceFromAttributes({ [ATTR_SERVICE_NAME]: process.env.OTEL_SERVICE_NAME ?? 'ui', [ATTR_SERVICE_VERSION]: pubEnv.PUBLIC_BUILD_VERSION ?? 'dev' }),