diff --git a/detectors/node/opentelemetry-resource-detector-instana/CHANGELOG.md b/detectors/node/opentelemetry-resource-detector-instana/CHANGELOG.md index a0c837a9bf..8ba712c085 100644 --- a/detectors/node/opentelemetry-resource-detector-instana/CHANGELOG.md +++ b/detectors/node/opentelemetry-resource-detector-instana/CHANGELOG.md @@ -6,6 +6,16 @@ * devDependencies * @opentelemetry/contrib-test-utils bumped from ^0.34.3 to ^0.35.0 +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @opentelemetry/semantic-conventions bumped from ^1.0.0 to ^1.22.0 + +### Enhancement + +* refactor: use exported strings for Semantic Resource Attributes + ## [0.7.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-instana-v0.6.0...resource-detector-instana-v0.7.0) (2024-03-06) diff --git a/detectors/node/opentelemetry-resource-detector-instana/README.md b/detectors/node/opentelemetry-resource-detector-instana/README.md index fef7b05bbd..ef67a8ecce 100644 --- a/detectors/node/opentelemetry-resource-detector-instana/README.md +++ b/detectors/node/opentelemetry-resource-detector-instana/README.md @@ -31,7 +31,7 @@ import { NodeSDK } from "@opentelemetry/sdk-node"; import { instanaAgentDetector } from "@opentelemetry/resource-detector-instana"; const globalResource = new Resource({ - [SemanticResourceAttributes.SERVICE_NAME]: "TestService", + [SEMRESATTRS_SERVICE_NAME]: "TestService", }); const sdk = new NodeSDK({ diff --git a/detectors/node/opentelemetry-resource-detector-instana/package.json b/detectors/node/opentelemetry-resource-detector-instana/package.json index adb3b93c1d..514e49f8e1 100644 --- a/detectors/node/opentelemetry-resource-detector-instana/package.json +++ b/detectors/node/opentelemetry-resource-detector-instana/package.json @@ -52,7 +52,7 @@ }, "dependencies": { "@opentelemetry/resources": "^1.0.0", - "@opentelemetry/semantic-conventions": "^1.0.0" + "@opentelemetry/semantic-conventions": "^1.22.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" diff --git a/detectors/node/opentelemetry-resource-detector-instana/src/detectors/InstanaAgentDetector.ts b/detectors/node/opentelemetry-resource-detector-instana/src/detectors/InstanaAgentDetector.ts index e036523240..4d9aabc70c 100644 --- a/detectors/node/opentelemetry-resource-detector-instana/src/detectors/InstanaAgentDetector.ts +++ b/detectors/node/opentelemetry-resource-detector-instana/src/detectors/InstanaAgentDetector.ts @@ -15,7 +15,10 @@ */ import { Detector, Resource, IResource } from '@opentelemetry/resources'; import { diag } from '@opentelemetry/api'; -import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions'; +import { + SEMRESATTRS_PROCESS_PID, + SEMRESATTRS_SERVICE_INSTANCE_ID, +} from '@opentelemetry/semantic-conventions'; import * as http from 'http'; class InstanaAgentDetector implements Detector { @@ -32,8 +35,8 @@ class InstanaAgentDetector implements Detector { const data = await this._retryHandler(host, port, 0); return new Resource({ - [SemanticResourceAttributes.PROCESS_PID]: data.pid, - [SemanticResourceAttributes.SERVICE_INSTANCE_ID]: data.agentUuid, + [SEMRESATTRS_PROCESS_PID]: data.pid, + [SEMRESATTRS_SERVICE_INSTANCE_ID]: data.agentUuid, }); } diff --git a/detectors/node/opentelemetry-resource-detector-instana/test/InstanaAgentDetectorIntegrationTest.test.ts b/detectors/node/opentelemetry-resource-detector-instana/test/InstanaAgentDetectorIntegrationTest.test.ts index ee8124f3cc..e99aa78487 100644 --- a/detectors/node/opentelemetry-resource-detector-instana/test/InstanaAgentDetectorIntegrationTest.test.ts +++ b/detectors/node/opentelemetry-resource-detector-instana/test/InstanaAgentDetectorIntegrationTest.test.ts @@ -21,7 +21,7 @@ import { processDetector, envDetector, } from '@opentelemetry/resources'; -import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions'; +import { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions'; import { NodeSDK } from '@opentelemetry/sdk-node'; import { instanaAgentDetector } from '../src'; @@ -54,7 +54,7 @@ describe('[Integration] instanaAgentDetector', () => { const serviceName = 'TestService'; const globalResource = new Resource({ - [SemanticResourceAttributes.SERVICE_NAME]: serviceName, + [SEMRESATTRS_SERVICE_NAME]: serviceName, }); const sdk = new NodeSDK({ @@ -93,7 +93,7 @@ describe('[Integration] instanaAgentDetector', () => { const serviceName = 'TestService'; const globalResource = new Resource({ - [SemanticResourceAttributes.SERVICE_NAME]: serviceName, + [SEMRESATTRS_SERVICE_NAME]: serviceName, }); const sdk = new NodeSDK({ diff --git a/package-lock.json b/package-lock.json index 65bcc6f9f4..9853349e90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -250,7 +250,7 @@ "license": "Apache-2.0", "dependencies": { "@opentelemetry/resources": "^1.0.0", - "@opentelemetry/semantic-conventions": "^1.0.0" + "@opentelemetry/semantic-conventions": "^1.22.0" }, "devDependencies": { "@opentelemetry/api": "^1.3.0", @@ -47978,7 +47978,7 @@ "@opentelemetry/contrib-test-utils": "^0.37.0", "@opentelemetry/resources": "^1.0.0", "@opentelemetry/sdk-node": "^0.49.1", - "@opentelemetry/semantic-conventions": "^1.0.0", + "@opentelemetry/semantic-conventions": "^1.22.0", "@types/mocha": "8.2.3", "@types/node": "18.6.5", "@types/semver": "7.5.3",