From 7f5f20c20aeac4bea80280eaf7fc353a0d96cafd Mon Sep 17 00:00:00 2001 From: Marylia Gutierrez Date: Thu, 25 Apr 2024 18:40:42 -0400 Subject: [PATCH] chore(examples/koa): use exported strings for attributes (#2123) Use exported strings for Semantic Attributes Signed-off-by: maryliag Refs: #2025 --- examples/koa/package.json | 1 + examples/koa/src/tracer.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/koa/package.json b/examples/koa/package.json index a3447a8273..9165d6ebdd 100644 --- a/examples/koa/package.json +++ b/examples/koa/package.json @@ -39,6 +39,7 @@ "@opentelemetry/instrumentation-koa": "^0.31.0", "@opentelemetry/sdk-trace-node": "^1.0.0", "@opentelemetry/sdk-trace-base": "^1.0.0", + "@opentelemetry/semantic-conventions": "^1.23.0", "axios": "^1.6.0", "koa": "^2.13.0" }, diff --git a/examples/koa/src/tracer.ts b/examples/koa/src/tracer.ts index 32bc6b166d..d0a3321a68 100644 --- a/examples/koa/src/tracer.ts +++ b/examples/koa/src/tracer.ts @@ -10,14 +10,14 @@ import { SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base'; import { JaegerExporter } from '@opentelemetry/exporter-jaeger'; import { ZipkinExporter } from '@opentelemetry/exporter-zipkin'; 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 }) });