From 929e3454544318d4c94bf7080b0fab6fe5bbe887 Mon Sep 17 00:00:00 2001 From: Kaung Zin Hein <83657429+Zen-cronic@users.noreply.github.com> Date: Wed, 5 Jun 2024 04:15:37 -0400 Subject: [PATCH] refactor(examples/grpc-js): use new exported string constants for semconv (#4760) * refactor(examples/grpc-js): use new exported string constants for semconv * updated semconv package ^1.22.0 * added changelog entry --------- Co-authored-by: Marc Pichler --- CHANGELOG.md | 1 + examples/grpc-js/package.json | 2 +- examples/grpc-js/tracer.js | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2b2fc581b..c681fd118f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/ ### :books: (Refine Doc) * refactor(examples): use new exported string constants for semconv in examples/http [#4750](https://github.com/open-telemetry/opentelemetry-js/pull/4750) @Zen-cronic +* refactor(examples): use new exported string constants for semconv in examples/grpc-js [#4760](https://github.com/open-telemetry/opentelemetry-js/pull/4760#pull) @Zen-cronic * refactor(examples): use new exported string constants for semconv in examples/otlp-exporter-node [#4762](https://github.com/open-telemetry/opentelemetry-js/pull/4762) @Zen-cronic * refactor(examples): use new exported string constants for semconv in examples/opentracing-shim [#4761](https://github.com/open-telemetry/opentelemetry-js/pull/4761) @Zen-cronic diff --git a/examples/grpc-js/package.json b/examples/grpc-js/package.json index 99dc941919..2ab39aae80 100644 --- a/examples/grpc-js/package.json +++ b/examples/grpc-js/package.json @@ -35,7 +35,7 @@ "@opentelemetry/instrumentation": "^0.27.0", "@opentelemetry/instrumentation-grpc": "^0.27.0", "@opentelemetry/resources": "^1.0.1", - "@opentelemetry/semantic-conventions": "^1.0.1", + "@opentelemetry/semantic-conventions": "^1.22.0", "@opentelemetry/sdk-trace-base": "^1.0.1", "@opentelemetry/sdk-trace-node": "^1.0.1", "google-protobuf": "^3.9.2" diff --git a/examples/grpc-js/tracer.js b/examples/grpc-js/tracer.js index 5c5a9edb86..77d30dbd1c 100644 --- a/examples/grpc-js/tracer.js +++ b/examples/grpc-js/tracer.js @@ -4,7 +4,7 @@ const opentelemetry = require('@opentelemetry/api'); const { registerInstrumentations } = require('@opentelemetry/instrumentation'); const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node'); const { Resource } = require('@opentelemetry/resources'); -const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions'); +const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions'); const { SimpleSpanProcessor } = require('@opentelemetry/sdk-trace-base'); const { JaegerExporter } = require('@opentelemetry/exporter-jaeger'); const { ZipkinExporter } = require('@opentelemetry/exporter-zipkin'); @@ -15,7 +15,7 @@ const EXPORTER = process.env.EXPORTER || ''; module.exports = (serviceName) => { const provider = new NodeTracerProvider({ resource: new Resource({ - [SemanticResourceAttributes.SERVICE_NAME]: serviceName, + [SEMRESATTRS_SERVICE_NAME]: serviceName, }), });