Skip to content

Commit

Permalink
chore(examples/koa): use exported strings for attributes (#2123)
Browse files Browse the repository at this point in the history
Use exported strings for Semantic Attributes

Signed-off-by: maryliag <marylia.gutierrez@grafana.com>
Refs: #2025
  • Loading branch information
maryliag committed Apr 25, 2024
1 parent e04362a commit 7f5f20c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/koa/package.json
Expand Up @@ -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"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/koa/src/tracer.ts
Expand Up @@ -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
})
});

Expand Down

0 comments on commit 7f5f20c

Please sign in to comment.