From 86ef50c8edbab751fee2603a88df397e79670359 Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Thu, 23 May 2024 10:59:32 +0200 Subject: [PATCH 1/2] update OTEL packages --- .changeset/dull-bees-accept.md | 18 + cspell.json | 1 + package.json | 26 +- packages/logger/src/logger-otel-transport.ts | 41 +- pnpm-lock.yaml | 632 ++++++------------- 5 files changed, 239 insertions(+), 479 deletions(-) create mode 100644 .changeset/dull-bees-accept.md diff --git a/.changeset/dull-bees-accept.md b/.changeset/dull-bees-accept.md new file mode 100644 index 000000000..ab4133053 --- /dev/null +++ b/.changeset/dull-bees-accept.md @@ -0,0 +1,18 @@ +--- +"@saleor/apps-logger": patch +"app-avatax": patch +"cms-v2": patch +"crm": patch +"data-importer": patch +"emails-and-messages": patch +"invoices": patch +"klaviyo": patch +"products-feed": patch +"search": patch +"segment": patch +"slack": patch +"smtp": patch +"app-taxjar": patch +--- + +Updated Open Telemetry SDK and API to latest versions diff --git a/cspell.json b/cspell.json index 10d3b4a53..9b21093fc 100644 --- a/cspell.json +++ b/cspell.json @@ -96,6 +96,7 @@ "**/schema.graphql", "**/*-generator.ts", "apps/*/src/**", + "packages/*/src/**", "apps/*/e2e/data/**", "**/*.bru", "**/.eslintrc", diff --git a/package.json b/package.json index cc8195524..7ad3a89c7 100644 --- a/package.json +++ b/package.json @@ -20,19 +20,19 @@ "test": "turbo run test" }, "dependencies": { - "@opentelemetry/api": "1.7.0", - "@opentelemetry/api-logs": "0.46.0", - "@opentelemetry/core": "1.19.0", - "@opentelemetry/exporter-logs-otlp-http": "0.46.0", - "@opentelemetry/exporter-trace-otlp-http": "0.46.0", - "@opentelemetry/instrumentation-http": "0.46.0", - "@opentelemetry/instrumentation-winston": "0.33.1", - "@opentelemetry/resources": "1.18.1", - "@opentelemetry/sdk-logs": "0.45.1", - "@opentelemetry/sdk-node": "0.45.1", - "@opentelemetry/sdk-trace-base": "1.18.1", - "@opentelemetry/sdk-trace-node": "1.18.1", - "@opentelemetry/semantic-conventions": "1.18.1", + "@opentelemetry/api": "1.8.0", + "@opentelemetry/api-logs": "0.51.1", + "@opentelemetry/core": "1.24.1", + "@opentelemetry/exporter-logs-otlp-http": "0.51.1", + "@opentelemetry/exporter-trace-otlp-http": "0.51.1", + "@opentelemetry/instrumentation-http": "0.51.1", + "@opentelemetry/instrumentation-winston": "0.37.0", + "@opentelemetry/resources": "1.24.1", + "@opentelemetry/sdk-logs": "0.51.1", + "@opentelemetry/sdk-node": "0.51.1", + "@opentelemetry/sdk-trace-base": "1.24.1", + "@opentelemetry/sdk-trace-node": "1.24.1", + "@opentelemetry/semantic-conventions": "1.24.1", "@saleor/app-sdk": "0.50.1" }, "devDependencies": { diff --git a/packages/logger/src/logger-otel-transport.ts b/packages/logger/src/logger-otel-transport.ts index 01e946ebf..1416ffb11 100644 --- a/packages/logger/src/logger-otel-transport.ts +++ b/packages/logger/src/logger-otel-transport.ts @@ -1,8 +1,13 @@ import { context } from "@opentelemetry/api"; -import { LogAttributeValue, logs } from "@opentelemetry/api-logs"; -import { SemanticResourceAttributes } from "@opentelemetry/semantic-conventions"; +import { logs } from "@opentelemetry/api-logs"; +import { + SEMRESATTRS_SERVICE_NAME, + SEMRESATTRS_SERVICE_VERSION, + SEMRESATTRS_DEPLOYMENT_ENVIRONMENT, +} from "@opentelemetry/semantic-conventions"; import { ILogObj, Logger } from "tslog"; import { LoggerContext } from "./logger-context"; +import { LogAttributes } from "@opentelemetry/api-logs/build/src/types/LogRecord"; export const attachLoggerOtelTransport = ( logger: Logger, @@ -27,19 +32,16 @@ export const attachLoggerOtelTransport = ( const serializedAttributes = Object.entries({ ...(loggerContext?.getRawContext() ?? {}), ...attributes, - }).reduce( - (acc, [key, value]) => { - if (Array.isArray(value)) { - acc[key] = JSON.stringify(value); - } else { - // @ts-expect-error - Logger maps attribute as IMeta, but in the runtime Meta is only in log._meta field which is filtered out first - acc[key] = value; - } + }).reduce((acc, [key, value]) => { + if (Array.isArray(value)) { + acc[key] = JSON.stringify(value); + } else { + // @ts-expect-error - Logger maps attribute as IMeta, but in the runtime Meta is only in log._meta field which is filtered out first + acc[key] = value; + } - return acc; - }, - {} as Record, - ); + return acc; + }, {} as LogAttributes); /** * Try to serialize Error. Modern-errors has plugin to serialize @@ -52,7 +54,7 @@ export const attachLoggerOtelTransport = ( */ try { const errorAttribute = serializedAttributes.error; - const ErrorConstructor = errorAttribute["constructor"]; + const ErrorConstructor = errorAttribute!["constructor"]; // @ts-expect-error - ErrorConstructor is a class that could have serialize method. If not, safely throw and ignore serializedAttributes.error = ErrorConstructor.serialize(serializedAttributes.error); @@ -60,19 +62,18 @@ export const attachLoggerOtelTransport = ( serializedAttributes.error.type = serializedAttributes.error.name; } catch (e) {} - logs.getLogger("app-logger-otel").emit({ + return logs.getLogger("app-logger-otel").emit({ body: log._meta.name ? `[${log._meta.name}] ${message}` : message, context: context.active(), severityText: log._meta.logLevelName, attributes: { ...serializedAttributes, - // eslint-disable-next-line turbo/no-undeclared-env-vars - [SemanticResourceAttributes.SERVICE_NAME]: process.env.OTEL_SERVICE_NAME, - [SemanticResourceAttributes.SERVICE_VERSION]: appVersion, + [SEMRESATTRS_SERVICE_NAME]: process.env.OTEL_SERVICE_NAME, + [SEMRESATTRS_SERVICE_VERSION]: appVersion, // eslint-disable-next-line turbo/no-undeclared-env-vars ["commit-sha"]: process.env.VERCEL_GIT_COMMIT_SHA, // eslint-disable-next-line turbo/no-undeclared-env-vars - [SemanticResourceAttributes.DEPLOYMENT_ENVIRONMENT]: process.env.ENV, + [SEMRESATTRS_DEPLOYMENT_ENVIRONMENT]: process.env.ENV, }, }); }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index be5e0e22a..b4e6e0562 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,44 +12,44 @@ importers: .: dependencies: '@opentelemetry/api': - specifier: 1.7.0 - version: 1.7.0 + specifier: 1.8.0 + version: 1.8.0 '@opentelemetry/api-logs': - specifier: 0.46.0 - version: 0.46.0 + specifier: 0.51.1 + version: 0.51.1 '@opentelemetry/core': - specifier: 1.19.0 - version: 1.19.0(@opentelemetry/api@1.7.0) + specifier: 1.24.1 + version: 1.24.1(@opentelemetry/api@1.8.0) '@opentelemetry/exporter-logs-otlp-http': - specifier: 0.46.0 - version: 0.46.0(@opentelemetry/api@1.7.0) + specifier: 0.51.1 + version: 0.51.1(@opentelemetry/api@1.8.0) '@opentelemetry/exporter-trace-otlp-http': - specifier: 0.46.0 - version: 0.46.0(@opentelemetry/api@1.7.0) + specifier: 0.51.1 + version: 0.51.1(@opentelemetry/api@1.8.0) '@opentelemetry/instrumentation-http': - specifier: 0.46.0 - version: 0.46.0(@opentelemetry/api@1.7.0) + specifier: 0.51.1 + version: 0.51.1(@opentelemetry/api@1.8.0) '@opentelemetry/instrumentation-winston': - specifier: 0.33.1 - version: 0.33.1(@opentelemetry/api@1.7.0) + specifier: 0.37.0 + version: 0.37.0(@opentelemetry/api@1.8.0) '@opentelemetry/resources': - specifier: 1.18.1 - version: 1.18.1(@opentelemetry/api@1.7.0) + specifier: 1.24.1 + version: 1.24.1(@opentelemetry/api@1.8.0) '@opentelemetry/sdk-logs': - specifier: 0.45.1 - version: 0.45.1(@opentelemetry/api-logs@0.46.0)(@opentelemetry/api@1.7.0) + specifier: 0.51.1 + version: 0.51.1(@opentelemetry/api-logs@0.51.1)(@opentelemetry/api@1.8.0) '@opentelemetry/sdk-node': - specifier: 0.45.1 - version: 0.45.1(@opentelemetry/api@1.7.0) + specifier: 0.51.1 + version: 0.51.1(@opentelemetry/api@1.8.0) '@opentelemetry/sdk-trace-base': - specifier: 1.18.1 - version: 1.18.1(@opentelemetry/api@1.7.0) + specifier: 1.24.1 + version: 1.24.1(@opentelemetry/api@1.8.0) '@opentelemetry/sdk-trace-node': - specifier: 1.18.1 - version: 1.18.1(@opentelemetry/api@1.7.0) + specifier: 1.24.1 + version: 1.24.1(@opentelemetry/api@1.8.0) '@opentelemetry/semantic-conventions': - specifier: 1.18.1 - version: 1.18.1 + specifier: 1.24.1 + version: 1.24.1 '@saleor/app-sdk': specifier: 0.50.1 version: 0.50.1(graphql@16.7.1)(next@14.2.3)(react-dom@18.2.0)(react@18.2.0) @@ -80,7 +80,7 @@ importers: version: 13.2.3 next: specifier: 14.2.3 - version: 14.2.3(@babel/core@7.24.3)(@opentelemetry/api@1.7.0)(react-dom@18.2.0)(react@18.2.0) + version: 14.2.3(@babel/core@7.24.3)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) prettier: specifier: 3.0.3 version: 3.0.3 @@ -2595,7 +2595,7 @@ importers: version: 7.33.2(eslint@8.46.0) next: specifier: 14.2.3 - version: 14.2.3(@babel/core@7.24.3)(@opentelemetry/api@1.7.0)(react-dom@18.2.0)(react@18.2.0) + version: 14.2.3(@babel/core@7.24.3)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) typescript: specifier: 5.1.6 version: 5.1.6 @@ -2797,7 +2797,7 @@ importers: version: link:../eslint-config-saleor next: specifier: 14.2.3 - version: 14.2.3(@babel/core@7.24.3)(@opentelemetry/api@1.7.0)(react-dom@18.2.0)(react@18.2.0) + version: 14.2.3(@babel/core@7.24.3)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) react: specifier: 18.2.0 version: 18.2.0 @@ -2864,7 +2864,7 @@ importers: version: link:../eslint-config-saleor next: specifier: 14.2.3 - version: 14.2.3(@babel/core@7.24.3)(@opentelemetry/api@1.7.0)(react-dom@18.2.0)(react@18.2.0) + version: 14.2.3(@babel/core@7.24.3)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) typescript: specifier: 5.1.6 version: 5.1.6 @@ -2895,7 +2895,7 @@ importers: version: link:../eslint-config-saleor next: specifier: 14.2.3 - version: 14.2.3(@babel/core@7.24.3)(@opentelemetry/api@1.7.0)(react-dom@18.2.0)(react@18.2.0) + version: 14.2.3(@babel/core@7.24.3)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) react: specifier: 18.2.0 version: 18.2.0 @@ -2928,7 +2928,7 @@ importers: version: 6.0.0(modern-errors@7.0.1) next: specifier: 14.2.3 - version: 14.2.3(@babel/core@7.24.3)(@opentelemetry/api@1.7.0)(react-dom@18.2.0)(react@18.2.0) + version: 14.2.3(@babel/core@7.24.3)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) semver: specifier: 7.5.1 version: 7.5.1 @@ -9664,6 +9664,7 @@ packages: /@grpc/proto-loader@0.7.10: resolution: {integrity: sha512-CAqDfoaQ8ykFd9zqBDn4k6iWT9loLAlc2ETmDFS9JCD70gDcnA4L3AFEo2iV7KyAtAAHFW9ftq1Fz+Vsgq80RQ==} engines: {node: '>=6'} + hasBin: true dependencies: lodash.camelcase: 4.3.0 long: 5.2.3 @@ -10089,49 +10090,22 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 - /@opentelemetry/api-logs@0.45.1: - resolution: {integrity: sha512-zVGq/k70l+kB/Wuv3O/zhptP2hvDhEbhDu9EtHde1iWZJf3FedeYS/nWVcMBkkyPAjS/JKNk86WN4CBQLGUuOw==} - engines: {node: '>=14'} - dependencies: - '@opentelemetry/api': 1.7.0 - dev: false - - /@opentelemetry/api-logs@0.46.0: - resolution: {integrity: sha512-+9BcqfiEDGPXEIo+o3tso/aqGM5dGbGwAkGVp3FPpZ8GlkK1YlaKRd9gMVyPaeRATwvO5wYGGnCsAc/sMMM9Qw==} - engines: {node: '>=14'} - dependencies: - '@opentelemetry/api': 1.7.0 - dev: false - /@opentelemetry/api-logs@0.50.0: resolution: {integrity: sha512-JdZuKrhOYggqOpUljAq4WWNi5nB10PmgoF0y2CvedLGXd0kSawb/UBnWT8gg1ND3bHCNHStAIVT0ELlxJJRqrA==} engines: {node: '>=14'} dependencies: - '@opentelemetry/api': 1.7.0 + '@opentelemetry/api': 1.8.0 /@opentelemetry/api-logs@0.51.1: resolution: {integrity: sha512-E3skn949Pk1z2XtXu/lxf6QAZpawuTM/IUEXcAzpiUkTd73Hmvw26FiN3cJuTmkpM5hZzHwkomVdtrh/n/zzwA==} engines: {node: '>=14'} dependencies: - '@opentelemetry/api': 1.7.0 - - /@opentelemetry/api@1.7.0: - resolution: {integrity: sha512-AdY5wvN0P2vXBi3b29hxZgSFvdhdxPB9+f0B6s//P9Q8nibRWeA3cHm8UmLpio9ABigkVHJ5NMPk+Mz8VCCyrw==} - engines: {node: '>=8.0.0'} + '@opentelemetry/api': 1.8.0 /@opentelemetry/api@1.8.0: resolution: {integrity: sha512-I/s6F7yKUDdtMsoBWXJe8Qz40Tui5vsuKCWJEWVL+5q9sSWRzzx6v2KeNsOBEwd94j0eWkpWCH4yB6rZg9Mf0w==} engines: {node: '>=8.0.0'} - /@opentelemetry/context-async-hooks@1.18.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-HHfJR32NH2x0b69CACCwH8m1dpNALoCTtpgmIWMNkeMGNUeKT48d4AX4xsF4uIRuUoRTbTgtSBRvS+cF97qwCQ==} - engines: {node: '>=14'} - peerDependencies: - '@opentelemetry/api': '>=1.0.0 <1.8.0' - dependencies: - '@opentelemetry/api': 1.7.0 - dev: false - /@opentelemetry/context-async-hooks@1.24.1(@opentelemetry/api@1.8.0): resolution: {integrity: sha512-R5r6DO4kgEOVBxFXhXjwospLQkv+sYxwCfjvoZBe7Zm6KKXAV9kDSJhi/D1BweowdZmO+sdbENLs374gER8hpQ==} engines: {node: '>=14'} @@ -10140,26 +10114,6 @@ packages: dependencies: '@opentelemetry/api': 1.8.0 - /@opentelemetry/core@1.18.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-kvnUqezHMhsQvdsnhnqTNfAJs3ox/isB0SVrM1dhVFw7SsB7TstuVa6fgWnN2GdPyilIFLUvvbTZoVRmx6eiRg==} - engines: {node: '>=14'} - peerDependencies: - '@opentelemetry/api': '>=1.0.0 <1.8.0' - dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/semantic-conventions': 1.18.1 - dev: false - - /@opentelemetry/core@1.19.0(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-w42AukJh3TP8R0IZZOVJVM/kMWu8g+lm4LzT70WtuKqhwq7KVhcDzZZuZinWZa6TtQCl7Smt2wolEYzpHabOgw==} - engines: {node: '>=14'} - peerDependencies: - '@opentelemetry/api': '>=1.0.0 <1.8.0' - dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/semantic-conventions': 1.19.0 - dev: false - /@opentelemetry/core@1.19.0(@opentelemetry/api@1.8.0): resolution: {integrity: sha512-w42AukJh3TP8R0IZZOVJVM/kMWu8g+lm4LzT70WtuKqhwq7KVhcDzZZuZinWZa6TtQCl7Smt2wolEYzpHabOgw==} engines: {node: '>=14'} @@ -10197,89 +10151,75 @@ packages: '@opentelemetry/semantic-conventions': 1.24.1 dev: false - /@opentelemetry/exporter-logs-otlp-http@0.46.0(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-XkVppqn4aArfaF7nE2fMou0pzrGLPKo7gjuYvQw39VD9GMtC8RSOt7aUUjaLdw/gFP5ZW4obZrclNttKdCUhwg==} + /@opentelemetry/exporter-logs-otlp-http@0.51.1(@opentelemetry/api@1.8.0): + resolution: {integrity: sha512-cd6GZ9IqCrmvOJwi1HjRR7o9ihF7xhZTekgxUsoyTsPF+SjKMsLF9ur6HeBYkYhk+YjZ1ken3XUMH47oUTvu8Q==} engines: {node: '>=14'} peerDependencies: '@opentelemetry/api': ^1.0.0 dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/api-logs': 0.46.0 - '@opentelemetry/core': 1.19.0(@opentelemetry/api@1.7.0) - '@opentelemetry/otlp-exporter-base': 0.46.0(@opentelemetry/api@1.7.0) - '@opentelemetry/otlp-transformer': 0.46.0(@opentelemetry/api@1.7.0) - '@opentelemetry/sdk-logs': 0.46.0(@opentelemetry/api-logs@0.46.0)(@opentelemetry/api@1.7.0) + '@opentelemetry/api': 1.8.0 + '@opentelemetry/api-logs': 0.51.1 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/otlp-exporter-base': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/otlp-transformer': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/sdk-logs': 0.51.1(@opentelemetry/api-logs@0.51.1)(@opentelemetry/api@1.8.0) dev: false - /@opentelemetry/exporter-trace-otlp-grpc@0.45.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-c/Wrn6LUqPiRgKhvMydau6kPz4ih6b/uwospiavjXju98ZfVv+KjaIF13cblW+4cQ6ZR3lm7t66umQfXrGBhPQ==} + /@opentelemetry/exporter-trace-otlp-grpc@0.51.1(@opentelemetry/api@1.8.0): + resolution: {integrity: sha512-P9+Hkszih95ITvldGZ+kXvj9HpD1QfS+PwooyHK72GYA+Bgm+yUSAsDkUkDms8+s9HW6poxURv3LcjaMuBBpVQ==} engines: {node: '>=14'} peerDependencies: '@opentelemetry/api': ^1.0.0 dependencies: '@grpc/grpc-js': 1.9.13 - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/otlp-grpc-exporter-base': 0.45.1(@opentelemetry/api@1.7.0) - '@opentelemetry/otlp-transformer': 0.45.1(@opentelemetry/api@1.7.0) - '@opentelemetry/resources': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/sdk-trace-base': 1.18.1(@opentelemetry/api@1.7.0) - dev: false - - /@opentelemetry/exporter-trace-otlp-http@0.45.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-a6CGqSG66n5R1mghzLMzyzn3iGap1b0v+0PjKFjfYuwLtpHQBxh2PHxItu+m2mXSwnM4R0GJlk9oUW5sQkCE0w==} - engines: {node: '>=14'} - peerDependencies: - '@opentelemetry/api': ^1.0.0 - dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/otlp-exporter-base': 0.45.1(@opentelemetry/api@1.7.0) - '@opentelemetry/otlp-transformer': 0.45.1(@opentelemetry/api@1.7.0) - '@opentelemetry/resources': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/sdk-trace-base': 1.18.1(@opentelemetry/api@1.7.0) + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/otlp-grpc-exporter-base': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/otlp-transformer': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/resources': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/sdk-trace-base': 1.24.1(@opentelemetry/api@1.8.0) dev: false - /@opentelemetry/exporter-trace-otlp-http@0.46.0(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-vZ2pYOB+qrQ+jnKPY6Gnd58y1k/Ti//Ny6/XsSX7/jED0X77crtSVgC6N5UA0JiGJOh6QB2KE9gaH99010XHzg==} + /@opentelemetry/exporter-trace-otlp-http@0.51.1(@opentelemetry/api@1.8.0): + resolution: {integrity: sha512-n+LhLPsX07URh+HhV2SHVSvz1t4G/l/CE5BjpmhAPqeTceFac1VpyQkavWEJbvnK5bUEXijWt4LxAxFpt2fXyw==} engines: {node: '>=14'} peerDependencies: '@opentelemetry/api': ^1.0.0 dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.19.0(@opentelemetry/api@1.7.0) - '@opentelemetry/otlp-exporter-base': 0.46.0(@opentelemetry/api@1.7.0) - '@opentelemetry/otlp-transformer': 0.46.0(@opentelemetry/api@1.7.0) - '@opentelemetry/resources': 1.19.0(@opentelemetry/api@1.7.0) - '@opentelemetry/sdk-trace-base': 1.19.0(@opentelemetry/api@1.7.0) + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/otlp-exporter-base': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/otlp-transformer': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/resources': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/sdk-trace-base': 1.24.1(@opentelemetry/api@1.8.0) dev: false - /@opentelemetry/exporter-trace-otlp-proto@0.45.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-8QI6QARxNP4y9RUpuQxXjw2HyRNyeuD9CWEhS5ON44Mt+XP7YbOZR3GLx2Ml2JZ8uzB5dd2EGlMgaMuZe36D5Q==} + /@opentelemetry/exporter-trace-otlp-proto@0.51.1(@opentelemetry/api@1.8.0): + resolution: {integrity: sha512-SE9f0/6V6EeXC9i+WA4WFjS1EYgaBCpAnI5+lxWvZ7iO7EU1IvHvZhP6Kojr0nLldo83gqg6G7OWFqsID3uF+w==} engines: {node: '>=14'} peerDependencies: '@opentelemetry/api': ^1.0.0 dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/otlp-exporter-base': 0.45.1(@opentelemetry/api@1.7.0) - '@opentelemetry/otlp-proto-exporter-base': 0.45.1(@opentelemetry/api@1.7.0) - '@opentelemetry/otlp-transformer': 0.45.1(@opentelemetry/api@1.7.0) - '@opentelemetry/resources': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/sdk-trace-base': 1.18.1(@opentelemetry/api@1.7.0) + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/otlp-exporter-base': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/otlp-proto-exporter-base': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/otlp-transformer': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/resources': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/sdk-trace-base': 1.24.1(@opentelemetry/api@1.8.0) dev: false - /@opentelemetry/exporter-zipkin@1.18.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-RmoWVFXFhvIh3q4szUe8I+/vxuMR0HNsOm39zNxnWJcK7JDwnPra9cLY/M78u6bTgB6Fte8GKgU128vvDzz0Iw==} + /@opentelemetry/exporter-zipkin@1.24.1(@opentelemetry/api@1.8.0): + resolution: {integrity: sha512-+Rl/VFmu2n6eaRMnVbyfZx1DqR/1KNyWebYuHyQBZaEAVIn/ZLgmofRpXN1X2nhJ4BNaptQUNxAstCYYz6dKoQ==} engines: {node: '>=14'} peerDependencies: '@opentelemetry/api': ^1.0.0 dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/resources': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/sdk-trace-base': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/semantic-conventions': 1.18.1 + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/resources': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/sdk-trace-base': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 dev: false /@opentelemetry/instrumentation-connect@0.35.0(@opentelemetry/api@1.8.0): @@ -10289,9 +10229,9 @@ packages: '@opentelemetry/api': ^1.3.0 dependencies: '@opentelemetry/api': 1.8.0 - '@opentelemetry/core': 1.19.0(@opentelemetry/api@1.8.0) + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) '@opentelemetry/instrumentation': 0.50.0(@opentelemetry/api@1.8.0) - '@opentelemetry/semantic-conventions': 1.18.1 + '@opentelemetry/semantic-conventions': 1.24.1 '@types/connect': 3.4.36 transitivePeerDependencies: - supports-color @@ -10303,9 +10243,9 @@ packages: '@opentelemetry/api': ^1.3.0 dependencies: '@opentelemetry/api': 1.8.0 - '@opentelemetry/core': 1.19.0(@opentelemetry/api@1.8.0) + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) '@opentelemetry/instrumentation': 0.48.0(@opentelemetry/api@1.8.0) - '@opentelemetry/semantic-conventions': 1.18.1 + '@opentelemetry/semantic-conventions': 1.24.1 transitivePeerDependencies: - supports-color @@ -10316,9 +10256,9 @@ packages: '@opentelemetry/api': ^1.3.0 dependencies: '@opentelemetry/api': 1.8.0 - '@opentelemetry/core': 1.19.0(@opentelemetry/api@1.8.0) + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) '@opentelemetry/instrumentation': 0.50.0(@opentelemetry/api@1.8.0) - '@opentelemetry/semantic-conventions': 1.18.1 + '@opentelemetry/semantic-conventions': 1.24.1 transitivePeerDependencies: - supports-color @@ -10340,26 +10280,11 @@ packages: '@opentelemetry/api': ^1.3.0 dependencies: '@opentelemetry/api': 1.8.0 - '@opentelemetry/core': 1.19.0(@opentelemetry/api@1.8.0) + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) - '@opentelemetry/semantic-conventions': 1.18.1 - transitivePeerDependencies: - - supports-color - - /@opentelemetry/instrumentation-http@0.46.0(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-t5cxgqfV9AcxVP00/OL1ggkOSZM57VXDpvlWaOidYyyfLKcUJ9e2fGbNwoVsGFboRDeH0iFo7gLA3EEvX13wCA==} - engines: {node: '>=14'} - peerDependencies: - '@opentelemetry/api': ^1.3.0 - dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.19.0(@opentelemetry/api@1.7.0) - '@opentelemetry/instrumentation': 0.46.0(@opentelemetry/api@1.7.0) - '@opentelemetry/semantic-conventions': 1.19.0 - semver: 7.5.4 + '@opentelemetry/semantic-conventions': 1.24.1 transitivePeerDependencies: - supports-color - dev: false /@opentelemetry/instrumentation-http@0.51.1(@opentelemetry/api@1.8.0): resolution: {integrity: sha512-6b3nZnFFEz/3xZ6w8bVxctPUWIPWiXuPQ725530JgxnN1cvYFd8CJ75PrHZNjynmzSSnqBkN3ef4R9N+RpMh8Q==} @@ -10399,7 +10324,7 @@ packages: '@opentelemetry/api': 1.8.0 '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) '@opentelemetry/redis-common': 0.36.2 - '@opentelemetry/semantic-conventions': 1.18.1 + '@opentelemetry/semantic-conventions': 1.24.1 transitivePeerDependencies: - supports-color @@ -10410,7 +10335,7 @@ packages: '@opentelemetry/api': ^1.3.0 dependencies: '@opentelemetry/api': 1.8.0 - '@opentelemetry/core': 1.19.0(@opentelemetry/api@1.8.0) + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) '@opentelemetry/instrumentation': 0.50.0(@opentelemetry/api@1.8.0) '@opentelemetry/semantic-conventions': 1.24.1 '@types/koa': 2.14.0 @@ -10427,7 +10352,7 @@ packages: '@opentelemetry/api': 1.8.0 '@opentelemetry/instrumentation': 0.48.0(@opentelemetry/api@1.8.0) '@opentelemetry/sdk-metrics': 1.19.0(@opentelemetry/api@1.8.0) - '@opentelemetry/semantic-conventions': 1.18.1 + '@opentelemetry/semantic-conventions': 1.24.1 transitivePeerDependencies: - supports-color @@ -10438,9 +10363,9 @@ packages: '@opentelemetry/api': ^1.3.0 dependencies: '@opentelemetry/api': 1.8.0 - '@opentelemetry/core': 1.19.0(@opentelemetry/api@1.8.0) + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) '@opentelemetry/instrumentation': 0.50.0(@opentelemetry/api@1.8.0) - '@opentelemetry/semantic-conventions': 1.18.1 + '@opentelemetry/semantic-conventions': 1.24.1 transitivePeerDependencies: - supports-color @@ -10452,7 +10377,7 @@ packages: dependencies: '@opentelemetry/api': 1.8.0 '@opentelemetry/instrumentation': 0.50.0(@opentelemetry/api@1.8.0) - '@opentelemetry/semantic-conventions': 1.18.1 + '@opentelemetry/semantic-conventions': 1.24.1 '@opentelemetry/sql-common': 0.40.1(@opentelemetry/api@1.8.0) transitivePeerDependencies: - supports-color @@ -10465,7 +10390,7 @@ packages: dependencies: '@opentelemetry/api': 1.8.0 '@opentelemetry/instrumentation': 0.50.0(@opentelemetry/api@1.8.0) - '@opentelemetry/semantic-conventions': 1.18.1 + '@opentelemetry/semantic-conventions': 1.24.1 '@types/mysql': 2.15.22 transitivePeerDependencies: - supports-color @@ -10478,7 +10403,7 @@ packages: dependencies: '@opentelemetry/api': 1.8.0 '@opentelemetry/instrumentation': 0.50.0(@opentelemetry/api@1.8.0) - '@opentelemetry/semantic-conventions': 1.18.1 + '@opentelemetry/semantic-conventions': 1.24.1 transitivePeerDependencies: - supports-color @@ -10497,26 +10422,27 @@ packages: transitivePeerDependencies: - supports-color - /@opentelemetry/instrumentation-winston@0.33.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-4tSORoAY9f+yzqNVGcGr/3GydPMfgSiKK1OESc+qBwVTz0bmz4cOrhCruCngGzoqDCmPYpwqwR/8j4wRKgcUpw==} + /@opentelemetry/instrumentation-winston@0.37.0(@opentelemetry/api@1.8.0): + resolution: {integrity: sha512-vOx55fxdNjo2XojJf8JN4jP7VVvQCh7UQzzQ2Q2FpGJpt8Z3EErKaY8xOBkOuJH0TtL/Q72rmIn9c+mRG46BxA==} engines: {node: '>=14'} peerDependencies: '@opentelemetry/api': ^1.3.0 dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/instrumentation': 0.46.0(@opentelemetry/api@1.7.0) + '@opentelemetry/api': 1.8.0 + '@opentelemetry/api-logs': 0.51.1 + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) transitivePeerDependencies: - supports-color dev: false - /@opentelemetry/instrumentation@0.43.0(@opentelemetry/api@1.7.0): + /@opentelemetry/instrumentation@0.43.0(@opentelemetry/api@1.8.0): resolution: {integrity: sha512-S1uHE+sxaepgp+t8lvIDuRgyjJWisAb733198kwQTUc9ZtYQ2V2gmyCtR1x21ePGVLoMiX/NWY7WA290hwkjJQ==} engines: {node: '>=14'} requiresBuild: true peerDependencies: '@opentelemetry/api': ^1.3.0 dependencies: - '@opentelemetry/api': 1.7.0 + '@opentelemetry/api': 1.8.0 '@types/shimmer': 1.0.5 import-in-the-middle: 1.4.2 require-in-the-middle: 7.2.0 @@ -10526,38 +10452,6 @@ packages: - supports-color optional: true - /@opentelemetry/instrumentation@0.45.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-V1Cr0g8hSg35lpW3G/GYVZurrhHrQZJdmP68WyJ83f1FDn3iru+/Vnlto9kiOSm7PHhW+pZGdb9Fbv+mkQ31CA==} - engines: {node: '>=14'} - peerDependencies: - '@opentelemetry/api': ^1.3.0 - dependencies: - '@opentelemetry/api': 1.7.0 - '@types/shimmer': 1.0.5 - import-in-the-middle: 1.4.2 - require-in-the-middle: 7.2.0 - semver: 7.5.4 - shimmer: 1.2.1 - transitivePeerDependencies: - - supports-color - dev: false - - /@opentelemetry/instrumentation@0.46.0(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-a9TijXZZbk0vI5TGLZl+0kxyFfrXHhX6Svtz7Pp2/VBlCSKrazuULEyoJQrOknJyFWNMEmbbJgOciHCCpQcisw==} - engines: {node: '>=14'} - peerDependencies: - '@opentelemetry/api': ^1.3.0 - dependencies: - '@opentelemetry/api': 1.7.0 - '@types/shimmer': 1.0.5 - import-in-the-middle: 1.7.1 - require-in-the-middle: 7.2.0 - semver: 7.5.4 - shimmer: 1.2.1 - transitivePeerDependencies: - - supports-color - dev: false - /@opentelemetry/instrumentation@0.48.0(@opentelemetry/api@1.8.0): resolution: {integrity: sha512-sjtZQB5PStIdCw5ovVTDGwnmQC+GGYArJNgIcydrDSqUTdYBnMrN9P4pwQZgS3vTGIp+TU1L8vMXGe51NVmIKQ==} engines: {node: '>=14'} @@ -10622,127 +10516,80 @@ packages: - supports-color dev: false - /@opentelemetry/otlp-exporter-base@0.45.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-Jvd6x8EwWGKEPWF4tkP4LpTPXiIkkafMNMvMJUfJd5DyNAftL1vAz+48jmi3URL2LMPkGryrvWPz8Tdu917gQw==} + /@opentelemetry/otlp-exporter-base@0.51.1(@opentelemetry/api@1.8.0): + resolution: {integrity: sha512-UYlnOYyDdzo1Gw559EHCzru0RwhvuXCwoH8jGo9J4gO1TE58GjnEmIjomMsKBCym3qWNJfIQXw+9SZCV0DdQNg==} engines: {node: '>=14'} peerDependencies: '@opentelemetry/api': ^1.0.0 dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.18.1(@opentelemetry/api@1.7.0) - dev: false - - /@opentelemetry/otlp-exporter-base@0.46.0(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-hfkh7cG17l77ZSLRAogz19SIJzr0KeC7xv5PDyTFbHFpwwoxV/bEViO49CqUFH6ckXB63NrltASP9R7po+ahTQ==} - engines: {node: '>=14'} - peerDependencies: - '@opentelemetry/api': ^1.0.0 - dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.19.0(@opentelemetry/api@1.7.0) + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) dev: false - /@opentelemetry/otlp-grpc-exporter-base@0.45.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-81X4mlzaAFoQCSXCgvYoMFyTy3mBhf8DD3J8bjW6/PH/rGZPJJkyYW0/YzepMrmBZXqlKZpTOU1aJ8sebVvDvw==} + /@opentelemetry/otlp-grpc-exporter-base@0.51.1(@opentelemetry/api@1.8.0): + resolution: {integrity: sha512-ZAS+4pq8o7dsugGTwV9s6JMKSxi+guIHdn0acOv0bqj26e9pWDFx5Ky+bI0aY46uR9Y0JyXqY+KAEYM/SO3DFA==} engines: {node: '>=14'} peerDependencies: '@opentelemetry/api': ^1.0.0 dependencies: '@grpc/grpc-js': 1.9.13 - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/otlp-exporter-base': 0.45.1(@opentelemetry/api@1.7.0) + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/otlp-exporter-base': 0.51.1(@opentelemetry/api@1.8.0) protobufjs: 7.2.5 dev: false - /@opentelemetry/otlp-proto-exporter-base@0.45.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-jtDkly6EW8TZHpbPpwJV9YT5PgbtL5B2UU8zcyGDiLT1wkIAYjFJZ1AqWmROIpydu8ohMq0dRwe4u0izNMdHpA==} + /@opentelemetry/otlp-proto-exporter-base@0.51.1(@opentelemetry/api@1.8.0): + resolution: {integrity: sha512-gxxxwfk0inDMb5DLeuxQ3L8TtptxSiTNHE4nnAJH34IQXAVRhXSXW1rK8PmDKDngRPIZ6J7ncUCjjIn8b+AgqQ==} engines: {node: '>=14'} peerDependencies: '@opentelemetry/api': ^1.0.0 dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/otlp-exporter-base': 0.45.1(@opentelemetry/api@1.7.0) + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/otlp-exporter-base': 0.51.1(@opentelemetry/api@1.8.0) protobufjs: 7.2.5 dev: false - /@opentelemetry/otlp-transformer@0.45.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-FhIHgfC0b0XtoBrS5ISfva939yWffNl47ypXR8I7Ru+dunlySpmf2TLocKHYLHGcWiuoeSNO5O4dZCmSKOtpXw==} - engines: {node: '>=14'} - peerDependencies: - '@opentelemetry/api': '>=1.3.0 <1.8.0' - dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/api-logs': 0.45.1 - '@opentelemetry/core': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/resources': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/sdk-logs': 0.45.1(@opentelemetry/api-logs@0.45.1)(@opentelemetry/api@1.7.0) - '@opentelemetry/sdk-metrics': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/sdk-trace-base': 1.18.1(@opentelemetry/api@1.7.0) - dev: false - - /@opentelemetry/otlp-transformer@0.46.0(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-Fj9hZwr6xuqgsaERn667Uf6kuDG884puWhyrai2Jen2Fq+bGf4/5BzEJp/8xvty0VSU4EfXOto/ys3KpSz2UHg==} + /@opentelemetry/otlp-transformer@0.51.1(@opentelemetry/api@1.8.0): + resolution: {integrity: sha512-OppYOXwV9LQqqtYUCywqoOqX/JT9LQ5/FMuPZ//eTkvuHdUC4ZMwz2c6uSoT2R90GWvvGnF1iEqTGyTT3xAt2Q==} engines: {node: '>=14'} peerDependencies: - '@opentelemetry/api': '>=1.3.0 <1.8.0' + '@opentelemetry/api': '>=1.3.0 <1.9.0' dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/api-logs': 0.46.0 - '@opentelemetry/core': 1.19.0(@opentelemetry/api@1.7.0) - '@opentelemetry/resources': 1.19.0(@opentelemetry/api@1.7.0) - '@opentelemetry/sdk-logs': 0.46.0(@opentelemetry/api-logs@0.46.0)(@opentelemetry/api@1.7.0) - '@opentelemetry/sdk-metrics': 1.19.0(@opentelemetry/api@1.7.0) - '@opentelemetry/sdk-trace-base': 1.19.0(@opentelemetry/api@1.7.0) + '@opentelemetry/api': 1.8.0 + '@opentelemetry/api-logs': 0.51.1 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/resources': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/sdk-logs': 0.51.1(@opentelemetry/api-logs@0.51.1)(@opentelemetry/api@1.8.0) + '@opentelemetry/sdk-metrics': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/sdk-trace-base': 1.24.1(@opentelemetry/api@1.8.0) dev: false - /@opentelemetry/propagator-b3@1.18.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-oSTUOsnt31JDx5SoEy27B5jE1/tiPvvE46w7CDKj0R5oZhCCfYH2bbSGa7NOOyDXDNqQDkgqU1DIV/xOd3f8pw==} + /@opentelemetry/propagator-b3@1.24.1(@opentelemetry/api@1.8.0): + resolution: {integrity: sha512-nda97ZwhpZKyUJTXqQuKzNhPMUgMLunbbGWn8kroBwegn+nh6OhtyGkrVQsQLNdVKJl0KeB5z0ZgeWszrYhwFw==} engines: {node: '>=14'} peerDependencies: - '@opentelemetry/api': '>=1.0.0 <1.8.0' + '@opentelemetry/api': '>=1.0.0 <1.9.0' dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.18.1(@opentelemetry/api@1.7.0) + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) dev: false - /@opentelemetry/propagator-jaeger@1.18.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-Kh4M1Qewv0Tbmts6D8LgNzx99IjdE18LCmY/utMkgVyU7Bg31Yuj+X6ZyoIRKPcD2EV4rVkuRI16WVMRuGbhWA==} + /@opentelemetry/propagator-jaeger@1.24.1(@opentelemetry/api@1.8.0): + resolution: {integrity: sha512-7bRBJn3FG1l195A1m+xXRHvgzAOBsfmRi9uZ5Da18oTh7BLmNDiA8+kpk51FpTsU1PCikPVpRDNPhKVB6lyzZg==} engines: {node: '>=14'} peerDependencies: - '@opentelemetry/api': '>=1.0.0 <1.8.0' + '@opentelemetry/api': '>=1.0.0 <1.9.0' dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.18.1(@opentelemetry/api@1.7.0) + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) dev: false /@opentelemetry/redis-common@0.36.2: resolution: {integrity: sha512-faYX1N0gpLhej/6nyp6bgRjzAKXn5GOEMYY7YhciSfCoITAktLUtQ36d24QEWNA1/WA1y6qQunCe0OhHRkVl9g==} engines: {node: '>=14'} - /@opentelemetry/resources@1.18.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-JjbcQLYMttXcIabflLRuaw5oof5gToYV9fuXbcsoOeQ0BlbwUn6DAZi++PNsSz2jjPeASfDls10iaO/8BRIPRA==} - engines: {node: '>=14'} - peerDependencies: - '@opentelemetry/api': '>=1.0.0 <1.8.0' - dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/semantic-conventions': 1.18.1 - dev: false - - /@opentelemetry/resources@1.19.0(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-RgxvKuuMOf7nctOeOvpDjt2BpZvZGr9Y0vf7eGtY5XYZPkh2p7e2qub1S2IArdBMf9kEbz0SfycqCviOu9isqg==} - engines: {node: '>=14'} - peerDependencies: - '@opentelemetry/api': '>=1.0.0 <1.8.0' - dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.19.0(@opentelemetry/api@1.7.0) - '@opentelemetry/semantic-conventions': 1.19.0 - dev: false - /@opentelemetry/resources@1.19.0(@opentelemetry/api@1.8.0): resolution: {integrity: sha512-RgxvKuuMOf7nctOeOvpDjt2BpZvZGr9Y0vf7eGtY5XYZPkh2p7e2qub1S2IArdBMf9kEbz0SfycqCviOu9isqg==} engines: {node: '>=14'} @@ -10773,67 +10620,17 @@ packages: '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) '@opentelemetry/semantic-conventions': 1.24.1 - /@opentelemetry/sdk-logs@0.45.1(@opentelemetry/api-logs@0.45.1)(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-z0RRgW4LeKEKnhXS4F/HnqB6+7gsy63YK47F4XAJYHs4s1KKg8XnQ2RkbuL31i/a9nXkylttYtvsT50CGr487g==} - engines: {node: '>=14'} - peerDependencies: - '@opentelemetry/api': '>=1.4.0 <1.8.0' - '@opentelemetry/api-logs': '>=0.39.1' - dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/api-logs': 0.45.1 - '@opentelemetry/core': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/resources': 1.18.1(@opentelemetry/api@1.7.0) - dev: false - - /@opentelemetry/sdk-logs@0.45.1(@opentelemetry/api-logs@0.46.0)(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-z0RRgW4LeKEKnhXS4F/HnqB6+7gsy63YK47F4XAJYHs4s1KKg8XnQ2RkbuL31i/a9nXkylttYtvsT50CGr487g==} - engines: {node: '>=14'} - peerDependencies: - '@opentelemetry/api': '>=1.4.0 <1.8.0' - '@opentelemetry/api-logs': '>=0.39.1' - dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/api-logs': 0.46.0 - '@opentelemetry/core': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/resources': 1.18.1(@opentelemetry/api@1.7.0) - dev: false - - /@opentelemetry/sdk-logs@0.46.0(@opentelemetry/api-logs@0.46.0)(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-Knlyk4+G72uEzNh6GRN1Fhmrj+/rkATI5/lOrevN7zRDLgp4kfyZBGGoWk7w+qQjlYvwhIIdPVxlIcipivdZIg==} + /@opentelemetry/sdk-logs@0.51.1(@opentelemetry/api-logs@0.51.1)(@opentelemetry/api@1.8.0): + resolution: {integrity: sha512-ULQQtl82b673PpZc5/0EtH4V+BrwVOgKJZEB7tYZnGTG3I98tQVk89S9/JSixomDr++F4ih+LSJTCqIKBz+MQQ==} engines: {node: '>=14'} peerDependencies: - '@opentelemetry/api': '>=1.4.0 <1.8.0' + '@opentelemetry/api': '>=1.4.0 <1.9.0' '@opentelemetry/api-logs': '>=0.39.1' dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/api-logs': 0.46.0 - '@opentelemetry/core': 1.19.0(@opentelemetry/api@1.7.0) - '@opentelemetry/resources': 1.19.0(@opentelemetry/api@1.7.0) - dev: false - - /@opentelemetry/sdk-metrics@1.18.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-TEFgeNFhdULBYiCoHbz31Y4PDsfjjxRp8Wmdp6ybLQZPqMNEb+dRq+XN8Xw3ivIgTaf9gYsomgV5ensX99RuEQ==} - engines: {node: '>=14'} - peerDependencies: - '@opentelemetry/api': '>=1.3.0 <1.8.0' - dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/resources': 1.18.1(@opentelemetry/api@1.7.0) - lodash.merge: 4.6.2 - dev: false - - /@opentelemetry/sdk-metrics@1.19.0(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-FiMii40zr0Fmys4F1i8gmuCvbinBnBsDeGBr4FQemOf0iPCLytYQm5AZJ/nn4xSc71IgKBQwTFQRAGJI7JvZ4Q==} - engines: {node: '>=14'} - peerDependencies: - '@opentelemetry/api': '>=1.3.0 <1.8.0' - dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.19.0(@opentelemetry/api@1.7.0) - '@opentelemetry/resources': 1.19.0(@opentelemetry/api@1.7.0) - lodash.merge: 4.6.2 + '@opentelemetry/api': 1.8.0 + '@opentelemetry/api-logs': 0.51.1 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/resources': 1.24.1(@opentelemetry/api@1.8.0) dev: false /@opentelemetry/sdk-metrics@1.19.0(@opentelemetry/api@1.8.0): @@ -10847,52 +10644,40 @@ packages: '@opentelemetry/resources': 1.19.0(@opentelemetry/api@1.8.0) lodash.merge: 4.6.2 - /@opentelemetry/sdk-node@0.45.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-VtYvlz2ydfJLuOUhCnGER69mz2KUYk3/kpbqI1FWlUP+kzTwivMuy7hIPPv6KmuOIMYWmW4lM+WyJACHqNvROw==} + /@opentelemetry/sdk-metrics@1.24.1(@opentelemetry/api@1.8.0): + resolution: {integrity: sha512-FrAqCbbGao9iKI+Mgh+OsC9+U2YMoXnlDHe06yH7dvavCKzE3S892dGtX54+WhSFVxHR/TMRVJiK/CV93GR0TQ==} engines: {node: '>=14'} peerDependencies: - '@opentelemetry/api': '>=1.3.0 <1.8.0' + '@opentelemetry/api': '>=1.3.0 <1.9.0' dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/api-logs': 0.45.1 - '@opentelemetry/core': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/exporter-trace-otlp-grpc': 0.45.1(@opentelemetry/api@1.7.0) - '@opentelemetry/exporter-trace-otlp-http': 0.45.1(@opentelemetry/api@1.7.0) - '@opentelemetry/exporter-trace-otlp-proto': 0.45.1(@opentelemetry/api@1.7.0) - '@opentelemetry/exporter-zipkin': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/instrumentation': 0.45.1(@opentelemetry/api@1.7.0) - '@opentelemetry/resources': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/sdk-logs': 0.45.1(@opentelemetry/api-logs@0.45.1)(@opentelemetry/api@1.7.0) - '@opentelemetry/sdk-metrics': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/sdk-trace-base': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/sdk-trace-node': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/semantic-conventions': 1.18.1 - transitivePeerDependencies: - - supports-color - dev: false - - /@opentelemetry/sdk-trace-base@1.18.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-tRHfDxN5dO+nop78EWJpzZwHsN1ewrZRVVwo03VJa3JQZxToRDH29/+MB24+yoa+IArerdr7INFJiX/iN4gjqg==} - engines: {node: '>=14'} - peerDependencies: - '@opentelemetry/api': '>=1.0.0 <1.8.0' - dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/resources': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/semantic-conventions': 1.18.1 + '@opentelemetry/api': 1.8.0 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/resources': 1.24.1(@opentelemetry/api@1.8.0) + lodash.merge: 4.6.2 dev: false - /@opentelemetry/sdk-trace-base@1.19.0(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-+IRvUm+huJn2KqfFW3yW/cjvRwJ8Q7FzYHoUNx5Fr0Lws0LxjMJG1uVB8HDpLwm7mg5XXH2M5MF+0jj5cM8BpQ==} + /@opentelemetry/sdk-node@0.51.1(@opentelemetry/api@1.8.0): + resolution: {integrity: sha512-GgmNF9C+6esr8PIJxCqHw84rEOkYm6XdFWZ2+Wyc3qaUt92ACoN7uSw5iKNvaUq62W0xii1wsGxwHzyENtPP8w==} engines: {node: '>=14'} peerDependencies: - '@opentelemetry/api': '>=1.0.0 <1.8.0' + '@opentelemetry/api': '>=1.3.0 <1.9.0' dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/core': 1.19.0(@opentelemetry/api@1.7.0) - '@opentelemetry/resources': 1.19.0(@opentelemetry/api@1.7.0) - '@opentelemetry/semantic-conventions': 1.19.0 + '@opentelemetry/api': 1.8.0 + '@opentelemetry/api-logs': 0.51.1 + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/exporter-trace-otlp-grpc': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/exporter-trace-otlp-http': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/exporter-trace-otlp-proto': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/exporter-zipkin': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/api@1.8.0) + '@opentelemetry/resources': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/sdk-logs': 0.51.1(@opentelemetry/api-logs@0.51.1)(@opentelemetry/api@1.8.0) + '@opentelemetry/sdk-metrics': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/sdk-trace-base': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/sdk-trace-node': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 + transitivePeerDependencies: + - supports-color dev: false /@opentelemetry/sdk-trace-base@1.23.0(@opentelemetry/api@1.8.0): @@ -10917,25 +10702,21 @@ packages: '@opentelemetry/resources': 1.24.1(@opentelemetry/api@1.8.0) '@opentelemetry/semantic-conventions': 1.24.1 - /@opentelemetry/sdk-trace-node@1.18.1(@opentelemetry/api@1.7.0): - resolution: {integrity: sha512-ML0l9TNlfLoplLF1F8lb95NGKgdm6OezDS3Ymqav9sYxMd5bnH2LZVzd4xEF+ov5vpZJOGdWxJMs2nC9no7+xA==} + /@opentelemetry/sdk-trace-node@1.24.1(@opentelemetry/api@1.8.0): + resolution: {integrity: sha512-/FZX8uWaGIAwsDhqI8VvQ+qWtfMNlXjaFYGc+vmxgdRFppCSSIRwrPyIhJO1qx61okyYhoyxVEZAfoiNxrfJCg==} engines: {node: '>=14'} peerDependencies: - '@opentelemetry/api': '>=1.0.0 <1.8.0' + '@opentelemetry/api': '>=1.0.0 <1.9.0' dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/context-async-hooks': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/core': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/propagator-b3': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/propagator-jaeger': 1.18.1(@opentelemetry/api@1.7.0) - '@opentelemetry/sdk-trace-base': 1.18.1(@opentelemetry/api@1.7.0) + '@opentelemetry/api': 1.8.0 + '@opentelemetry/context-async-hooks': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/propagator-b3': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/propagator-jaeger': 1.24.1(@opentelemetry/api@1.8.0) + '@opentelemetry/sdk-trace-base': 1.24.1(@opentelemetry/api@1.8.0) semver: 7.5.4 dev: false - /@opentelemetry/semantic-conventions@1.18.1: - resolution: {integrity: sha512-+NLGHr6VZwcgE/2lw8zDIufOCGnzsA5CbQIMleXZTrgkBd0TanCX+MiDYJ1TOS4KL/Tqk0nFRxawnaYr6pkZkA==} - engines: {node: '>=14'} - /@opentelemetry/semantic-conventions@1.19.0: resolution: {integrity: sha512-14jRpC8f5c0gPSwoZ7SbEJni1PqI+AhAE8m1bMz6v+RPM4OlP1PT2UHBJj5Qh/ALLPjhVU/aZUK3YyjTUqqQVg==} engines: {node: '>=14'} @@ -10955,7 +10736,7 @@ packages: '@opentelemetry/api': ^1.1.0 dependencies: '@opentelemetry/api': 1.8.0 - '@opentelemetry/core': 1.19.0(@opentelemetry/api@1.8.0) + '@opentelemetry/core': 1.24.1(@opentelemetry/api@1.8.0) /@peculiar/asn1-schema@2.3.6: resolution: {integrity: sha512-izNRxPoaeJeg/AyH8hER6s+H7p4itk+03QCa4sbxI3lNdseQYCuxzgsuNK8bTXChtLTjpJz6NmXKA73qLa3rCA==} @@ -11968,12 +11749,12 @@ packages: '@vercel/kv': optional: true dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/semantic-conventions': 1.18.1 + '@opentelemetry/api': 1.8.0 + '@opentelemetry/semantic-conventions': 1.24.1 debug: 4.3.4 graphql: 16.7.1 jose: 4.14.4 - next: 14.2.3(@opentelemetry/api@1.7.0)(react-dom@18.2.0)(react@18.2.0) + next: 14.2.3(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) raw-body: 2.5.2 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -13497,7 +13278,7 @@ packages: '@trpc/client': 10.34.0(@trpc/server@10.34.0) '@trpc/react-query': 10.34.0(@tanstack/react-query@4.29.19)(@trpc/client@10.34.0)(@trpc/server@10.34.0)(react-dom@18.2.0)(react@18.2.0) '@trpc/server': 10.34.0 - next: 14.2.3(@opentelemetry/api@1.7.0)(react-dom@18.2.0)(react@18.2.0) + next: 14.2.3(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) react-ssr-prepass: 1.5.0(react@18.2.0) @@ -19638,11 +19419,13 @@ packages: /import-in-the-middle@1.4.2: resolution: {integrity: sha512-9WOz1Yh/cvO/p69sxRmhyQwrIGGSp7EIdcb+fFNVi7CzQGQB8U1/1XrKVSbEd/GNOAeM0peJtmi7+qphe7NvAw==} + requiresBuild: true dependencies: acorn: 8.11.3 acorn-import-assertions: 1.9.0(acorn@8.11.3) cjs-module-lexer: 1.2.3 module-details-from-path: 1.0.3 + optional: true /import-in-the-middle@1.7.1: resolution: {integrity: sha512-1LrZPDtW+atAxH42S6288qyDFNQ2YCty+2mxEPRtfazH6Z5QwkaBSTS2ods7hnVJioF6rkRfNoA6A/MstpFXLg==} @@ -21895,48 +21678,6 @@ packages: resolution: {integrity: sha512-amlnNvPXmiUOmNsDfUngNWPdZYOmCUGExQy/kuPCmLbhrXVXIYhY4bnE4D3dWl7OMhSEr9NndUrl4aKGFhFIQg==} dev: false - /next@14.2.3(@babel/core@7.24.3)(@opentelemetry/api@1.7.0)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-dowFkFTR8v79NPJO4QsBUtxv0g9BrS/phluVpMAt2ku7H+cbcBJlopXjkWlwxrk/xGqMemr7JkGPGemPrLLX7A==} - engines: {node: '>=18.17.0'} - hasBin: true - peerDependencies: - '@opentelemetry/api': ^1.1.0 - '@playwright/test': ^1.41.2 - react: ^18.2.0 - react-dom: ^18.2.0 - sass: ^1.3.0 - peerDependenciesMeta: - '@opentelemetry/api': - optional: true - '@playwright/test': - optional: true - sass: - optional: true - dependencies: - '@next/env': 14.2.3 - '@opentelemetry/api': 1.7.0 - '@swc/helpers': 0.5.5 - busboy: 1.6.0 - caniuse-lite: 1.0.30001588 - graceful-fs: 4.2.11 - postcss: 8.4.31 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - styled-jsx: 5.1.1(@babel/core@7.24.3)(react@18.2.0) - optionalDependencies: - '@next/swc-darwin-arm64': 14.2.3 - '@next/swc-darwin-x64': 14.2.3 - '@next/swc-linux-arm64-gnu': 14.2.3 - '@next/swc-linux-arm64-musl': 14.2.3 - '@next/swc-linux-x64-gnu': 14.2.3 - '@next/swc-linux-x64-musl': 14.2.3 - '@next/swc-win32-arm64-msvc': 14.2.3 - '@next/swc-win32-ia32-msvc': 14.2.3 - '@next/swc-win32-x64-msvc': 14.2.3 - transitivePeerDependencies: - - '@babel/core' - - babel-plugin-macros - /next@14.2.3(@babel/core@7.24.3)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-dowFkFTR8v79NPJO4QsBUtxv0g9BrS/phluVpMAt2ku7H+cbcBJlopXjkWlwxrk/xGqMemr7JkGPGemPrLLX7A==} engines: {node: '>=18.17.0'} @@ -21978,7 +21719,6 @@ packages: transitivePeerDependencies: - '@babel/core' - babel-plugin-macros - dev: true /next@14.2.3(@babel/core@7.24.3)(@opentelemetry/api@node_modules+@opentelemetry+api)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-dowFkFTR8v79NPJO4QsBUtxv0g9BrS/phluVpMAt2ku7H+cbcBJlopXjkWlwxrk/xGqMemr7JkGPGemPrLLX7A==} @@ -22023,7 +21763,7 @@ packages: - babel-plugin-macros dev: false - /next@14.2.3(@opentelemetry/api@1.7.0)(react-dom@18.2.0)(react@18.2.0): + /next@14.2.3(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-dowFkFTR8v79NPJO4QsBUtxv0g9BrS/phluVpMAt2ku7H+cbcBJlopXjkWlwxrk/xGqMemr7JkGPGemPrLLX7A==} engines: {node: '>=18.17.0'} hasBin: true @@ -22042,7 +21782,7 @@ packages: optional: true dependencies: '@next/env': 14.2.3 - '@opentelemetry/api': 1.7.0 + '@opentelemetry/api': 1.8.0 '@swc/helpers': 0.5.5 busboy: 1.6.0 caniuse-lite: 1.0.30001588 @@ -22504,9 +22244,9 @@ packages: engines: {node: '>18.0.0'} requiresBuild: true dependencies: - '@opentelemetry/api': 1.7.0 - '@opentelemetry/instrumentation': 0.43.0(@opentelemetry/api@1.7.0) - '@opentelemetry/semantic-conventions': 1.18.1 + '@opentelemetry/api': 1.8.0 + '@opentelemetry/instrumentation': 0.43.0(@opentelemetry/api@1.8.0) + '@opentelemetry/semantic-conventions': 1.24.1 transitivePeerDependencies: - supports-color optional: true From 618518efbab0d7377b0521f894ecf51f04272ecc Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Thu, 23 May 2024 13:20:12 +0200 Subject: [PATCH 2/2] refactor semantic attributes imports --- .../otel/src/get-attributes-from-request.ts | 20 ++++++++++++------- packages/otel/src/instrumentation.ts | 19 ++++++++++-------- packages/otel/src/otel-exchange.ts | 4 ++-- packages/otel/src/otel-wrapper.ts | 14 ++++++++----- 4 files changed, 35 insertions(+), 22 deletions(-) diff --git a/packages/otel/src/get-attributes-from-request.ts b/packages/otel/src/get-attributes-from-request.ts index 014356973..20a706da5 100644 --- a/packages/otel/src/get-attributes-from-request.ts +++ b/packages/otel/src/get-attributes-from-request.ts @@ -1,5 +1,11 @@ import { NextApiRequest } from "next"; -import { SemanticAttributes } from "@opentelemetry/semantic-conventions"; +import { + SEMATTRS_FAAS_EXECUTION, + SEMATTRS_HTTP_METHOD, + SEMATTRS_HTTP_TARGET, + SEMATTRS_HTTP_USER_AGENT, + SEMATTRS_NET_HOST_NAME, +} from "@opentelemetry/semantic-conventions"; import { SALEOR_API_URL_HEADER } from "@saleor/app-sdk/const"; const pruneEmptyKeys = (obj: Record): Record => { @@ -18,16 +24,16 @@ const pruneEmptyKeys = (obj: Record): Record => export const getAttributesFromRequest = (request: NextApiRequest) => { const attributes = { - [SemanticAttributes.FAAS_EXECUTION]: request.headers["x-vercel-proxy-signature-ts"] as string, - [SemanticAttributes.HTTP_USER_AGENT]: request.headers["user-agent"] as string, - [SemanticAttributes.HTTP_TARGET]: request.headers.referer as string, - [SemanticAttributes.NET_HOST_NAME]: request.headers.host as string, - [SemanticAttributes.HTTP_METHOD]: (request.method ?? "").toUpperCase(), + [SEMATTRS_FAAS_EXECUTION]: request.headers["x-vercel-proxy-signature-ts"] as string, + [SEMATTRS_HTTP_USER_AGENT]: request.headers["user-agent"] as string, + [SEMATTRS_HTTP_TARGET]: request.headers.referer as string, + [SEMATTRS_NET_HOST_NAME]: request.headers.host as string, + [SEMATTRS_HTTP_METHOD]: (request.method ?? "").toUpperCase(), saleorApiUrl: request.headers[SALEOR_API_URL_HEADER] as string, "url.path": request.url, vercelRequestId: request.headers["x-vercel-id"], requestId: request.headers["x-vercel-proxy-signature-ts"] as string, - } as const ; + } as const; return pruneEmptyKeys(attributes); }; diff --git a/packages/otel/src/instrumentation.ts b/packages/otel/src/instrumentation.ts index f3735d8d9..38ddb5d00 100644 --- a/packages/otel/src/instrumentation.ts +++ b/packages/otel/src/instrumentation.ts @@ -4,8 +4,11 @@ import { HttpInstrumentation } from "@opentelemetry/instrumentation-http"; import { Resource } from "@opentelemetry/resources"; import { NodeSDK } from "@opentelemetry/sdk-node"; import { - SemanticAttributes, - SemanticResourceAttributes, + SEMRESATTRS_SERVICE_NAME, + SEMRESATTRS_DEPLOYMENT_ENVIRONMENT, + SEMATTRS_HTTP_ROUTE, + SEMATTRS_HTTP_STATUS_CODE, + SEMATTRS_HTTP_HOST, } from "@opentelemetry/semantic-conventions"; import { type ClientRequest } from "node:http"; import { otelLogsProcessor } from "./otel-logs-setup"; @@ -18,14 +21,14 @@ if (process.env.ENABLE_DEBUG_OTEL_DIAG === "true") { export const otelSdk = new NodeSDK({ resource: new Resource({ // eslint-disable-next-line turbo/no-undeclared-env-vars - [SemanticResourceAttributes.SERVICE_NAME]: process.env.OTEL_SERVICE_NAME, + [SEMRESATTRS_SERVICE_NAME]: process.env.OTEL_SERVICE_NAME, // [SemanticResourceAttributes.SERVICE_VERSION]: pkg.version, TODO // eslint-disable-next-line turbo/no-undeclared-env-vars "commit-sha": process.env.VERCEL_GIT_COMMIT_SHA, // eslint-disable-next-line turbo/no-undeclared-env-vars - [SemanticResourceAttributes.DEPLOYMENT_ENVIRONMENT]: process.env.ENV, + [SEMRESATTRS_DEPLOYMENT_ENVIRONMENT]: process.env.ENV, }), - spanProcessor: batchSpanProcessor, + spanProcessors: [batchSpanProcessor], logRecordProcessor: otelLogsProcessor, textMapPropagator: new W3CTraceContextPropagator(), instrumentations: [ @@ -37,11 +40,11 @@ export const otelSdk = new NodeSDK({ * TODO Fix this. */ applyCustomAttributesOnSpan: (span, req, response) => { - span.setAttribute(SemanticAttributes.HTTP_ROUTE, (req as ClientRequest)?.path); - span.setAttribute(SemanticAttributes.HTTP_HOST, (req as ClientRequest)?.host); + span.setAttribute(SEMATTRS_HTTP_ROUTE, (req as ClientRequest)?.path); + span.setAttribute(SEMATTRS_HTTP_HOST, (req as ClientRequest)?.host); if (response.statusCode) { - span.setAttribute(SemanticAttributes.HTTP_STATUS_CODE, response.statusCode); + span.setAttribute(SEMATTRS_HTTP_STATUS_CODE, response.statusCode); } if (response.statusCode && response.statusCode >= 400) { diff --git a/packages/otel/src/otel-exchange.ts b/packages/otel/src/otel-exchange.ts index 8bae1d92e..b8972875e 100644 --- a/packages/otel/src/otel-exchange.ts +++ b/packages/otel/src/otel-exchange.ts @@ -3,7 +3,7 @@ import { type CombinedError, type Operation, makeOperation, mapExchange } from " import { getOtelTracer } from "./otel-tracer"; import { GraphQLAttributeNames, ObservabilityAttributes } from "./lib/observability-attributes"; import { addInputVariableAttributes, addRequestHeaderAttributes } from "./otel-graphql-utils"; -import { SemanticAttributes } from "@opentelemetry/semantic-conventions"; +import { SEMATTRS_HTTP_URL } from "@opentelemetry/semantic-conventions"; type Definition = { name: { @@ -50,7 +50,7 @@ export const otelExchange = mapExchange({ span.setAttribute(ObservabilityAttributes.SALEOR_API_URL, operation.context.url); - span.setAttribute(SemanticAttributes.HTTP_URL, operation.context.url); + span.setAttribute(SEMATTRS_HTTP_URL, operation.context.url); addRequestHeaderAttributes(span, operation.context.fetchOptions?.headers); if (operation.variables) { diff --git a/packages/otel/src/otel-wrapper.ts b/packages/otel/src/otel-wrapper.ts index b4abff08c..65c2092ce 100644 --- a/packages/otel/src/otel-wrapper.ts +++ b/packages/otel/src/otel-wrapper.ts @@ -1,5 +1,9 @@ import { SpanKind, SpanStatusCode, type Span } from "@opentelemetry/api"; -import { SemanticAttributes } from "@opentelemetry/semantic-conventions"; +import { + SEMATTRS_HTTP_METHOD, + SEMATTRS_HTTP_ROUTE, + SEMATTRS_HTTP_STATUS_CODE, +} from "@opentelemetry/semantic-conventions"; import { type NextApiHandler, type NextApiRequest, type NextApiResponse } from "next"; import { otelSdk } from "./instrumentation"; @@ -63,13 +67,13 @@ export const withOtel = (handler: NextApiHandler, staticRouteName: string): Next const attributesFromRequest = getAttributesFromRequest(req); return tracer.startActiveSpan( - `${attributesFromRequest[SemanticAttributes.HTTP_METHOD]} ${staticRouteName}`, + `${attributesFromRequest[SEMATTRS_HTTP_METHOD]} ${staticRouteName}`, { kind: SpanKind.SERVER, attributes: attributesFromRequest, }, async (span) => { - span.setAttribute(SemanticAttributes.HTTP_ROUTE, staticRouteName); + span.setAttribute(SEMATTRS_HTTP_ROUTE, staticRouteName); const originalResEnd = res.end; @@ -78,7 +82,7 @@ export const withOtel = (handler: NextApiHandler, staticRouteName: string): Next */ // @ts-expect-error - this is a hack to get around Vercel freezing lambda's res.end = async function (this: unknown, ...args: unknown[]) { - span.setAttribute(SemanticAttributes.HTTP_STATUS_CODE, res.statusCode); + span.setAttribute(SEMATTRS_HTTP_STATUS_CODE, res.statusCode); span.end(); try { @@ -97,7 +101,7 @@ export const withOtel = (handler: NextApiHandler, staticRouteName: string): Next wrappingTarget.apply(thisArg, [req, res]); } catch (error) { - span.setAttribute(SemanticAttributes.HTTP_STATUS_CODE, 500); + span.setAttribute(SEMATTRS_HTTP_STATUS_CODE, 500); setErrorOnSpan(error, span);