Skip to content

Commit

Permalink
chore(opentelemetry-resources): add instance type and az to aws detector
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Walz <[email protected]>
  • Loading branch information
justinwalz committed May 14, 2020
1 parent 7ccf1d0 commit 89e47d4
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 89e47d4

Please sign in to comment.