Skip to content

Commit 83e6af0

Browse files
mweardyladan
andauthored
chore: remove duplicate hostname resource attribute (#1581)
Co-authored-by: Daniel Dyla <[email protected]>
1 parent e62c481 commit 83e6af0

File tree

4 files changed

+0
-13
lines changed

4 files changed

+0
-13
lines changed

packages/opentelemetry-resource-detector-aws/src/detectors/AwsEc2Detector.ts

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ class AwsEc2Detector implements Detector {
7171
[HOST_RESOURCE.ID]: instanceId,
7272
[HOST_RESOURCE.TYPE]: instanceType,
7373
[HOST_RESOURCE.NAME]: hostname,
74-
[HOST_RESOURCE.HOSTNAME]: hostname,
7574
});
7675
}
7776

packages/opentelemetry-resources/src/constants.ts

-6
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ export const CONTAINER_RESOURCE = {
4747

4848
/** Attributes defining a computing instance (e.g. host). */
4949
export const HOST_RESOURCE = {
50-
/**
51-
* Hostname of the host. It contains what the hostname command returns on the
52-
* host machine.
53-
*/
54-
HOSTNAME: 'host.hostname',
55-
5650
/**
5751
* Unique host id. For Cloud this must be the instance_id assigned by the
5852
* cloud provider

packages/opentelemetry-resources/test/resource-assertions.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ describe('assertHostResource', () => {
8989

9090
it('validates optional attributes', () => {
9191
const resource = new Resource({
92-
[HOST_RESOURCE.HOSTNAME]: 'opentelemetry-test-hostname',
9392
[HOST_RESOURCE.ID]: 'opentelemetry-test-id',
9493
[HOST_RESOURCE.NAME]: 'opentelemetry-test-name',
9594
[HOST_RESOURCE.TYPE]: 'n1-standard-1',

packages/opentelemetry-resources/test/util/resource-assertions.ts

-5
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,6 @@ export const assertHostResource = (
122122
}
123123
) => {
124124
assertHasOneLabel(HOST_RESOURCE, resource);
125-
if (validations.hostName)
126-
assert.strictEqual(
127-
resource.attributes[HOST_RESOURCE.HOSTNAME],
128-
validations.hostName
129-
);
130125
if (validations.id)
131126
assert.strictEqual(resource.attributes[HOST_RESOURCE.ID], validations.id);
132127
if (validations.name)

0 commit comments

Comments
 (0)