Skip to content

Commit

Permalink
chore(examples/mysql): use exported strings for attributes (#2126)
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 c96293d commit 09c8e42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/mysql/package.json
Expand Up @@ -39,6 +39,7 @@
"@opentelemetry/instrumentation-mysql": "^0.31.0",
"@opentelemetry/sdk-trace-base": "^1.0.0",
"@opentelemetry/sdk-trace-node": "^1.0.0",
"@opentelemetry/semantic-conventions": "^1.23.0",
"@opentelemetry/exporter-metrics-otlp-grpc": "^0.48.0",
"mysql": "^2.18.1"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/mysql/src/tracer.ts
Expand Up @@ -9,7 +9,7 @@ import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
import { MySQLInstrumentation } from '@opentelemetry/instrumentation-mysql';
import { Resource } from '@opentelemetry/resources';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
import { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
import {
MeterProvider,
PeriodicExportingMetricReader,
Expand All @@ -33,7 +33,7 @@ export const setupTracing = (serviceName: string) => {
//traces:
const tracerProvider = new NodeTracerProvider({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: serviceName,
[SEMRESATTRS_SERVICE_NAME]: serviceName,
}),});

if (EXPORTER.toLowerCase().startsWith('z')) {
Expand Down

0 comments on commit 09c8e42

Please sign in to comment.