From 58ace1157dbd03fe3e29a83f6a489e77fe03339b Mon Sep 17 00:00:00 2001 From: maryliag Date: Fri, 19 Apr 2024 14:32:17 -0400 Subject: [PATCH] chore(examples/redis): use exported strings for attributes Use exported strings for Semantic Attributes --- examples/redis/package.json | 1 + examples/redis/src/tracer.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/redis/package.json b/examples/redis/package.json index fedef04c8d..5e989b9fd2 100644 --- a/examples/redis/package.json +++ b/examples/redis/package.json @@ -39,6 +39,7 @@ "@opentelemetry/instrumentation-redis": "^0.32.0", "@opentelemetry/sdk-trace-base": "^1.0.0", "@opentelemetry/sdk-trace-node": "^1.0.0", + "@opentelemetry/semantic-conventions": "^1.23.0", "axios": "^1.6.0", "express": "^4.17.1", "redis": "^3.1.1" diff --git a/examples/redis/src/tracer.ts b/examples/redis/src/tracer.ts index e50633493a..de70a60418 100644 --- a/examples/redis/src/tracer.ts +++ b/examples/redis/src/tracer.ts @@ -9,14 +9,14 @@ import { registerInstrumentations } from '@opentelemetry/instrumentation'; import { HttpInstrumentation } from '@opentelemetry/instrumentation-http'; import { RedisInstrumentation } from '@opentelemetry/instrumentation-redis'; import { Resource } from '@opentelemetry/resources'; -import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions'; +import { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions'; const EXPORTER = process.env.EXPORTER || ''; export const setupTracing = (serviceName: string) => { const provider = new NodeTracerProvider({ resource: new Resource({ - [SemanticResourceAttributes.SERVICE_NAME]: serviceName, + [SEMRESATTRS_SERVICE_NAME]: serviceName, }),}); let exporter;