chore: remove duplicate hostname resource attribute (#1581)

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
This commit is contained in:
Matthew Wear 2020-10-09 08:59:16 -07:00 committed by GitHub
parent e62c4817bc
commit 83e6af093d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 13 deletions

View File

@ -71,7 +71,6 @@ class AwsEc2Detector implements Detector {
[HOST_RESOURCE.ID]: instanceId,
[HOST_RESOURCE.TYPE]: instanceType,
[HOST_RESOURCE.NAME]: hostname,
[HOST_RESOURCE.HOSTNAME]: hostname,
});
}

View File

@ -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

View File

@ -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',

View File

@ -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)