diff --git a/examples/mongodb/package.json b/examples/mongodb/package.json index f96cd0feb2..7bf097e553 100644 --- a/examples/mongodb/package.json +++ b/examples/mongodb/package.json @@ -38,6 +38,7 @@ "@opentelemetry/instrumentation-mongodb": "^0.32.0", "@opentelemetry/sdk-trace-node": "^1.0.0", "@opentelemetry/sdk-trace-base": "^1.0.0", + "@opentelemetry/semantic-conventions": "^1.23.0", "mongodb": "^3.6.11" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib#readme", diff --git a/examples/mongodb/src/tracer.ts b/examples/mongodb/src/tracer.ts index e38075df25..4e63724503 100644 --- a/examples/mongodb/src/tracer.ts +++ b/examples/mongodb/src/tracer.ts @@ -8,13 +8,13 @@ import { ZipkinExporter } from '@opentelemetry/exporter-zipkin'; import { registerInstrumentations } from '@opentelemetry/instrumentation'; import { HttpInstrumentation } from '@opentelemetry/instrumentation-http'; import { MongoDBInstrumentation } from '@opentelemetry/instrumentation-mongodb'; -import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions'; +import { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions'; export const setupTracing = (serviceName: string): api.Tracer => { const provider = new NodeTracerProvider({ resource: new Resource({ - [SemanticResourceAttributes.SERVICE_NAME]: serviceName + [SEMRESATTRS_SERVICE_NAME]: serviceName }) });