Skip to content

Commit

Permalink
chore: remove duplicate hostname resource attribute (#1581)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Dyla <[email protected]>
  • Loading branch information
mwear and dyladan authored Oct 9, 2020
1 parent e62c481 commit 83e6af0
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class AwsEc2Detector implements Detector {
[HOST_RESOURCE.ID]: instanceId,
[HOST_RESOURCE.TYPE]: instanceType,
[HOST_RESOURCE.NAME]: hostname,
[HOST_RESOURCE.HOSTNAME]: hostname,
});
}

Expand Down
6 changes: 0 additions & 6 deletions packages/opentelemetry-resources/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ export const CONTAINER_RESOURCE = {

/** Attributes defining a computing instance (e.g. host). */
export const HOST_RESOURCE = {
/**
* Hostname of the host. It contains what the hostname command returns on the
* host machine.
*/
HOSTNAME: 'host.hostname',

/**
* Unique host id. For Cloud this must be the instance_id assigned by the
* cloud provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ describe('assertHostResource', () => {

it('validates optional attributes', () => {
const resource = new Resource({
[HOST_RESOURCE.HOSTNAME]: 'opentelemetry-test-hostname',
[HOST_RESOURCE.ID]: 'opentelemetry-test-id',
[HOST_RESOURCE.NAME]: 'opentelemetry-test-name',
[HOST_RESOURCE.TYPE]: 'n1-standard-1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,6 @@ export const assertHostResource = (
}
) => {
assertHasOneLabel(HOST_RESOURCE, resource);
if (validations.hostName)
assert.strictEqual(
resource.attributes[HOST_RESOURCE.HOSTNAME],
validations.hostName
);
if (validations.id)
assert.strictEqual(resource.attributes[HOST_RESOURCE.ID], validations.id);
if (validations.name)
Expand Down

0 comments on commit 83e6af0

Please sign in to comment.