From b282bade1a8633a1d3388e03e83b027ab24de213 Mon Sep 17 00:00:00 2001 From: Kaung Zin Hein <83657429+Zen-cronic@users.noreply.github.com> Date: Wed, 5 Jun 2024 04:13:39 -0400 Subject: [PATCH] refactor(experimental/examples/opencensus-shim): use new exported string constants for semconv (#4763) * refactor(experimental/examples/opencensus-shim): use new exported string constants for semconv * added changelog entry (experimental) --- experimental/CHANGELOG.md | 1 + experimental/examples/opencensus-shim/setup.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index 000e9ca9698..1c32d1e95ff 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -47,6 +47,7 @@ All notable changes to experimental packages in this project will be documented * docs(instrumentation): better docs for supportedVersions option [#4693](https://github.com/open-telemetry/opentelemetry-js/pull/4693) @blumamir * docs: align all supported versions to a common format [#4696](https://github.com/open-telemetry/opentelemetry-js/pull/4696) @blumamir +* refactor(examples): use new exported string constants for semconv in experimental/examples/opencensus-shim [#4763](https://github.com/open-telemetry/opentelemetry-js/pull/4763#pull) @Zen-cronic ### :house: (Internal) diff --git a/experimental/examples/opencensus-shim/setup.js b/experimental/examples/opencensus-shim/setup.js index 99bf8bf8b44..1bb277eddb4 100644 --- a/experimental/examples/opencensus-shim/setup.js +++ b/experimental/examples/opencensus-shim/setup.js @@ -27,7 +27,7 @@ const { const { PrometheusExporter } = require('@opentelemetry/exporter-prometheus'); const { Resource } = require('@opentelemetry/resources'); const { - SemanticResourceAttributes, + SEMRESATTRS_SERVICE_NAME, } = require('@opentelemetry/semantic-conventions'); const { OpenCensusMetricProducer } = require('@opentelemetry/shim-opencensus'); const instrumentationHttp = require('@opencensus/instrumentation-http'); @@ -46,7 +46,7 @@ module.exports = function setup(serviceName) { tracing.tracer = new oc.CoreTracer(); const resource = new Resource({ - [SemanticResourceAttributes.SERVICE_NAME]: serviceName, + [SEMRESATTRS_SERVICE_NAME]: serviceName, }); const tracerProvider = new NodeTracerProvider({ resource }); tracerProvider.addSpanProcessor(