From 89e47d447fd96fa1c2a988e9945dbacf7870255a Mon Sep 17 00:00:00 2001 From: Justin Walz Date: Wed, 13 May 2020 18:04:48 -0700 Subject: [PATCH] chore(opentelemetry-resources): add instance type and az to aws detector Signed-off-by: Justin Walz --- .../src/platform/node/detectors/AwsEc2Detector.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/opentelemetry-resources/src/platform/node/detectors/AwsEc2Detector.ts b/packages/opentelemetry-resources/src/platform/node/detectors/AwsEc2Detector.ts index d3317b9c099..7e68016925a 100644 --- a/packages/opentelemetry-resources/src/platform/node/detectors/AwsEc2Detector.ts +++ b/packages/opentelemetry-resources/src/platform/node/detectors/AwsEc2Detector.ts @@ -44,13 +44,17 @@ class AwsEc2Detector implements Detector { const { accountId, instanceId, + instanceType, region, + availabilityZone, } = await this._awsMetadataAccessor(); return new Resource({ [CLOUD_RESOURCE.PROVIDER]: 'aws', [CLOUD_RESOURCE.ACCOUNT_ID]: accountId, [CLOUD_RESOURCE.REGION]: region, + [CLOUD_RESOURCE.ZONE]: availabilityZone, [HOST_RESOURCE.ID]: instanceId, + [HOST_RESOURCE.TYPE]: instanceType, }); } catch { return Resource.empty();