From 896255cae4fea454ffc4c559ea29b08ccebbfcb2 Mon Sep 17 00:00:00 2001 From: "Chen, Zhi-Yuan" Date: Thu, 12 Sep 2024 16:31:01 +0900 Subject: [PATCH] fix deprecated semantic-conventions (#5162) --- .../en/docs/languages/js/instrumentation.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/content/en/docs/languages/js/instrumentation.md b/content/en/docs/languages/js/instrumentation.md index 3cd001056f1d..216acc7278ee 100644 --- a/content/en/docs/languages/js/instrumentation.md +++ b/content/en/docs/languages/js/instrumentation.md @@ -223,14 +223,14 @@ import { } from '@opentelemetry/sdk-metrics'; import { Resource } from '@opentelemetry/resources'; import { - SEMRESATTRS_SERVICE_NAME, - SEMRESATTRS_SERVICE_VERSION, + ATTR_SERVICE_NAME, + ATTR_SERVICE_VERSION, } from '@opentelemetry/semantic-conventions'; const sdk = new NodeSDK({ resource: new Resource({ - [SEMRESATTRS_SERVICE_NAME]: 'yourServiceName', - [SEMRESATTRS_SERVICE_VERSION]: '1.0', + [ATTR_SERVICE_NAME]: 'yourServiceName', + [ATTR_SERVICE_VERSION]: '1.0', }), traceExporter: new ConsoleSpanExporter(), metricReader: new PeriodicExportingMetricReader({ @@ -253,14 +253,14 @@ const { } = require('@opentelemetry/sdk-metrics'); const { Resource } = require('@opentelemetry/resources'); const { - SEMRESATTRS_SERVICE_NAME, - SEMRESATTRS_SERVICE_VERSION, + ATTR_SERVICE_NAME, + ATTR_SERVICE_VERSION, } = require('@opentelemetry/semantic-conventions'); const sdk = new NodeSDK({ resource: new Resource({ - [SEMRESATTRS_SERVICE_NAME]: 'dice-server', - [SEMRESATTRS_SERVICE_VERSION]: '0.1.0', + [ATTR_SERVICE_NAME]: 'dice-server', + [ATTR_SERVICE_VERSION]: '0.1.0', }), traceExporter: new ConsoleSpanExporter(), metricReader: new PeriodicExportingMetricReader({ @@ -352,8 +352,8 @@ SDK initialization code in it: ```ts import { Resource } from '@opentelemetry/resources'; import { - SEMRESATTRS_SERVICE_NAME, - SEMRESATTRS_SERVICE_VERSION, + ATTR_SERVICE_NAME, + ATTR_SERVICE_VERSION, } from '@opentelemetry/semantic-conventions'; import { WebTracerProvider } from '@opentelemetry/sdk-trace-web'; import { @@ -363,8 +363,8 @@ import { const resource = Resource.default().merge( new Resource({ - [SEMRESATTRS_SERVICE_NAME]: 'service-name-here', - [SEMRESATTRS_SERVICE_VERSION]: '0.1.0', + [ATTR_SERVICE_NAME]: 'service-name-here', + [ATTR_SERVICE_VERSION]: '0.1.0', }), ); @@ -384,8 +384,8 @@ provider.register(); const opentelemetry = require('@opentelemetry/api'); const { Resource } = require('@opentelemetry/resources'); const { - SEMRESATTRS_SERVICE_NAME, - SEMRESATTRS_SERVICE_VERSION, + ATTR_SERVICE_NAME, + ATTR_SERVICE_VERSION, } = require('@opentelemetry/semantic-conventions'); const { WebTracerProvider } = require('@opentelemetry/sdk-trace-web'); const { @@ -395,8 +395,8 @@ const { const resource = Resource.default().merge( new Resource({ - [SEMRESATTRS_SERVICE_NAME]: 'service-name-here', - [SEMRESATTRS_SERVICE_VERSION]: '0.1.0', + [ATTR_SERVICE_NAME]: 'service-name-here', + [ATTR_SERVICE_VERSION]: '0.1.0', }), ); @@ -1259,14 +1259,14 @@ import { } from '@opentelemetry/sdk-metrics'; import { Resource } from '@opentelemetry/resources'; import { - SEMRESATTRS_SERVICE_NAME, - SEMRESATTRS_SERVICE_VERSION, + ATTR_SERVICE_NAME, + ATTR_SERVICE_VERSION, } from '@opentelemetry/semantic-conventions'; const resource = Resource.default().merge( new Resource({ - [SEMRESATTRS_SERVICE_NAME]: 'dice-server', - [SEMRESATTRS_SERVICE_VERSION]: '0.1.0', + [ATTR_SERVICE_NAME]: 'dice-server', + [ATTR_SERVICE_VERSION]: '0.1.0', }), ); @@ -1296,14 +1296,14 @@ const { } = require('@opentelemetry/sdk-metrics'); const { Resource } = require('@opentelemetry/resources'); const { - SEMRESATTRS_SERVICE_NAME, - SEMRESATTRS_SERVICE_VERSION, + ATTR_SERVICE_NAME, + ATTR_SERVICE_VERSION, } = require('@opentelemetry/semantic-conventions'); const resource = Resource.default().merge( new Resource({ - [SEMRESATTRS_SERVICE_NAME]: 'service-name-here', - [SEMRESATTRS_SERVICE_VERSION]: '0.1.0', + [ATTR_SERVICE_NAME]: 'service-name-here', + [ATTR_SERVICE_VERSION]: '0.1.0', }), );