Skip to content

Commit

Permalink
chore(resource-detector-instana): use exported strings for attributes
Browse files Browse the repository at this point in the history
Use exported strings for Semantic Resource Attributes

Signed-off-by: maryliag <marylia.gutierrez@grafana.com>
  • Loading branch information
maryliag committed Mar 27, 2024
1 parent 85cbc8d commit 7c1d6b6
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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({
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7c1d6b6

Please sign in to comment.