Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove duplicate hostname resource attribute #1581

Merged
merged 2 commits into from
Oct 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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