chore: remove duplicate hostname resource attribute (#1581)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
This commit is contained in:
parent
e62c4817bc
commit
83e6af093d
|
|
@ -71,7 +71,6 @@ class AwsEc2Detector implements Detector {
|
||||||
[HOST_RESOURCE.ID]: instanceId,
|
[HOST_RESOURCE.ID]: instanceId,
|
||||||
[HOST_RESOURCE.TYPE]: instanceType,
|
[HOST_RESOURCE.TYPE]: instanceType,
|
||||||
[HOST_RESOURCE.NAME]: hostname,
|
[HOST_RESOURCE.NAME]: hostname,
|
||||||
[HOST_RESOURCE.HOSTNAME]: hostname,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,12 +47,6 @@ export const CONTAINER_RESOURCE = {
|
||||||
|
|
||||||
/** Attributes defining a computing instance (e.g. host). */
|
/** Attributes defining a computing instance (e.g. host). */
|
||||||
export const HOST_RESOURCE = {
|
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
|
* Unique host id. For Cloud this must be the instance_id assigned by the
|
||||||
* cloud provider
|
* cloud provider
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,6 @@ describe('assertHostResource', () => {
|
||||||
|
|
||||||
it('validates optional attributes', () => {
|
it('validates optional attributes', () => {
|
||||||
const resource = new Resource({
|
const resource = new Resource({
|
||||||
[HOST_RESOURCE.HOSTNAME]: 'opentelemetry-test-hostname',
|
|
||||||
[HOST_RESOURCE.ID]: 'opentelemetry-test-id',
|
[HOST_RESOURCE.ID]: 'opentelemetry-test-id',
|
||||||
[HOST_RESOURCE.NAME]: 'opentelemetry-test-name',
|
[HOST_RESOURCE.NAME]: 'opentelemetry-test-name',
|
||||||
[HOST_RESOURCE.TYPE]: 'n1-standard-1',
|
[HOST_RESOURCE.TYPE]: 'n1-standard-1',
|
||||||
|
|
|
||||||
|
|
@ -122,11 +122,6 @@ export const assertHostResource = (
|
||||||
}
|
}
|
||||||
) => {
|
) => {
|
||||||
assertHasOneLabel(HOST_RESOURCE, resource);
|
assertHasOneLabel(HOST_RESOURCE, resource);
|
||||||
if (validations.hostName)
|
|
||||||
assert.strictEqual(
|
|
||||||
resource.attributes[HOST_RESOURCE.HOSTNAME],
|
|
||||||
validations.hostName
|
|
||||||
);
|
|
||||||
if (validations.id)
|
if (validations.id)
|
||||||
assert.strictEqual(resource.attributes[HOST_RESOURCE.ID], validations.id);
|
assert.strictEqual(resource.attributes[HOST_RESOURCE.ID], validations.id);
|
||||||
if (validations.name)
|
if (validations.name)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue