From 73e01f281d2823e7f81e3efee2e0cb2a24e528e5 Mon Sep 17 00:00:00 2001 From: Marylia Gutierrez Date: Thu, 25 Apr 2024 04:34:35 -0400 Subject: [PATCH] chore(examples/graphql): use exported strings for attributes (#2122) Use exported strings for Semantic Attributes Co-authored-by: Trent Mick Co-authored-by: Amir Blum Co-authored-by: Marc Pichler --- examples/graphql/package.json | 2 +- examples/graphql/tracer.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/graphql/package.json b/examples/graphql/package.json index 53e8935933..6ca5a0371b 100644 --- a/examples/graphql/package.json +++ b/examples/graphql/package.json @@ -44,7 +44,7 @@ "@opentelemetry/resources": "~1.0.0", "@opentelemetry/sdk-trace-base": "~1.0.0", "@opentelemetry/sdk-trace-node": "~1.0.0", - "@opentelemetry/semantic-conventions": "~1.0.0", + "@opentelemetry/semantic-conventions": "^1.23.0", "apollo-server": "^2.18.1", "cross-fetch": "^3.0.5", "express": "^4.17.1", diff --git a/examples/graphql/tracer.js b/examples/graphql/tracer.js index 2545a20874..82a24edde8 100644 --- a/examples/graphql/tracer.js +++ b/examples/graphql/tracer.js @@ -8,11 +8,11 @@ const { OTLPTraceExporter } = require('@opentelemetry/exporter-otlp-http'); const { HttpInstrumentation } = require('@opentelemetry/instrumentation-http'); const { ExpressInstrumentation } = require('@opentelemetry/instrumentation-express'); const { Resource } = require('@opentelemetry/resources'); -const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions'); +const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions'); const provider = new NodeTracerProvider({ resource: new Resource({ - [SemanticResourceAttributes.SERVICE_NAME]: 'graphql-service', + [SEMRESATTRS_SERVICE_NAME]: 'graphql-service', }), });