1.4.2 • Published 7 days ago

@opentelemetry/resource-detector-aws v1.4.2

Weekly downloads
1,047
License
Apache-2.0
Repository
github
Last release
7 days ago

OpenTelemetry Resource Detector for AWS

NPM Published Version Apache License

component owners: @carolabadeer

Resource detector for Amazon Web Services.

Status

MaturityComponent OwnerCompatibility
Stable@carolabadeerAPI 1.0+SDK 1.0+

Installation

npm install --save @opentelemetry/resource-detector-aws

Usage

import { detectResources } from '@opentelemetry/resources';
import { awsEc2Detector } from '@opentelemetry/resource-detector-aws'
const resource = await detectResources({
   detectors: [awsEc2Detector],
})

const tracerProvider = new NodeTracerProvider({ resource });

Available detectors

This package uses @opentelemetry/semantic-conventions version 1.22+, which implements Semantic Convention Version 1.7.0

AWS Beanstalk Detector

Populates service for processes running on AWS Elastic Beanstalk

Resource AttributeDescription
cloud.platformThe cloud platform. In this context, it's always "aws_elastic_beanstalk"
cloud.providerThe cloud provider. In this context, it's always "aws"
service.instance.idValue of deployment_id from config file environment.conf
service.nameThe service name. In this context, it's always "aws_elastic_beanstalk"
service.namespaceValue of environment_name from config file environment.conf
service.versionValue of version_label from config file environment.conf

AWS EC2 Detector

Populates cloud and host for processes running on Amazon EC2, including abstractions such as ECS on EC2. Notably, it does not populate anything on AWS Fargate.

Resource AttributeDescription
cloud.account.idValue of accountId from /latest/dynamic/instance-identity/document request
cloud.availability_zoneValue of availabilityZone from /latest/dynamic/instance-identity/document request
cloud.platformThe cloud platform. In this context, it's always "aws_ec2"
cloud.providerThe cloud provider. In this context, it's always "aws"
cloud.regionValue of region from /latest/dynamic/instance-identity/document request
host.idValue of instanceId from /latest/dynamic/instance-identity/document request
host.nameValue of hostname from /latest/dynamic/instance-identity/document request
host.typeValue of instanceType from /latest/dynamic/instance-identity/document request

AWS ECS Detector

Populates container for containers running on Amazon ECS.

Resource AttributeDescription
aws.ecs.container.arnValue of ContainerARN from the request to the metadata Uri. The Metadata Uri is stored on the Environment Variable ECS_CONTAINER_METADATA_URI_V4
aws.ecs.cluster.arnValue in the format ${baseArn}:cluster/${cluster}, with baseArn and cluster from a ECS_CONTAINER_METADATA_URI_V4/task request, with values from TaskARN and Cluster respectively
aws.ecs.launchtypeValue of LaunchType from ECS_CONTAINER_METADATA_URI_V4/task request
aws.ecs.task.arnValue of TaskARN from ECS_CONTAINER_METADATA_URI_V4/task request
aws.ecs.task.familyValue of Family from ECS_CONTAINER_METADATA_URI_V4/task request
aws.ecs.task.revisionValue of Revision from ECS_CONTAINER_METADATA_URI_V4/task request
aws.log.group.arnsValue on format arn:aws:logs:${logsRegion}:${awsAccount}:log-group:${logsGroupName}, with logsRegions and logsGroupName from logs metadata, values of awslogs-region and awslogs-group respectively, and awsAccount parsed value from the TaskARN. Logs metadata values come from LogOptions on ECS_CONTAINER_METADATA_URI_V4 request
aws.log.group.namesValue of awslogs-group from logs metadata. Logs metadata values come from LogOptions on ECS_CONTAINER_METADATA_URI_V4 request
aws.log.stream.arnsValue on format arn:aws:logs:${logsRegion}:${awsAccount}:log-group:${logsGroupName}:log-stream:${logsStreamName}, with logsRegions, logsGroupName and logsStreamName from logs metadata, values of awslogs-region, awslogs-group and awslogs-stream respectively, and awsAccount parsed value from the TaskARN
aws.log.stream.namesValue of awslogs-stream from logs metadata
cloud.account.idParsed value from the TaskARN
cloud.availability_zoneValue of AvailabilityZone from ECS_CONTAINER_METADATA_URI_V4/task request. This value is not available in all Fargate runtimes
cloud.platformThe cloud platform. In this context, it's always "aws_ecs"
cloud.providerThe cloud provider. In this context, it's always "aws"
cloud.regionParsed value from the TaskARN
container.idValue of from file /proc/self/cgroup
container.nameThe hostname of the operating system

AWS EKS Detector

Populates container and k8s.cluster_name for containers running on Amazon EKS. k8s.cluster_name is not always available depending on the configuration of CloudWatch monitoring for the EKS cluster.

Resource AttributeDescription
cloud.platformThe cloud platform. In this context, it's always "aws_eks"
cloud.providerThe cloud provider. In this context, it's always "aws"
container.idValue from config file /proc/self/cgroup
k8s.cluster.nameValue of cluster.name from /api/v1/namespaces/amazon-cloudwatch/configmaps/cluster-info request

AWS Lambda Detector

Populates faas and cloud for functions running on AWS Lambda. faas.id is currently not populated as it is not provided by the runtime at startup.

Resource AttributeDescription
cloud.platformThe cloud platform. In this context, it's always "aws_lambda"
cloud.providerThe cloud provider. In this context, it's always "aws"
cloud.regionValue of Process Environment Variable AWS_REGION
faas.nameValue of Process Environment Variable AWS_LAMBDA_FUNCTION_NAME
faas.versionValue of Process Environment Variable AWS_LAMBDA_FUNCTION_VERSION

Useful links

License

Apache 2.0 - See LICENSE for more information.

1.4.2

7 days ago

1.4.1

29 days ago

1.4.0

2 months ago

1.3.6

3 months ago

1.3.5

4 months ago

1.3.4

5 months ago

1.3.3

6 months ago

1.3.2

7 months ago

1.3.1

9 months ago

1.3.0

10 months ago

1.2.5

11 months ago

1.2.4

12 months ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

3 years ago

0.25.0

3 years ago

0.24.1-alpha.7

3 years ago

0.24.1-alpha.5

3 years ago

0.24.1-alpha.4

3 years ago

0.24.1-alpha.1

3 years ago

0.23.1-alpha.26

3 years ago

0.24.1-alpha.31

3 years ago

0.23.1-alpha.28

3 years ago

0.24.0

3 years ago

0.23.1-alpha.24

3 years ago

0.23.1-alpha.23

3 years ago

0.23.1-alpha.15

3 years ago

0.23.1-alpha.3

3 years ago

0.23.1-alpha.17

3 years ago

0.23.1-alpha.18

3 years ago

0.22.1-alpha.16

3 years ago

0.22.1-alpha.15

3 years ago

0.23.0

3 years ago

0.22.1-alpha.13

3 years ago

0.22.1-alpha.2

3 years ago

0.22.1-alpha.3

3 years ago

0.22.1-alpha.5

3 years ago

0.22.0

3 years ago

0.20.0

3 years ago

0.21.1-alpha.2

3 years ago

0.21.1-alpha.1

3 years ago

0.21.1-alpha.7

3 years ago

0.21.0

3 years ago

0.19.1-alpha.43

3 years ago

0.20.1-alpha.4

3 years ago

0.20.1-alpha.3

3 years ago

0.20.1-alpha.49

3 years ago

0.19.1-alpha.38

3 years ago

0.19.1-alpha.26

3 years ago

0.19.1-alpha.21

3 years ago

0.19.1-alpha.25

3 years ago

0.19.0

3 years ago

0.19.1-alpha.19

3 years ago

0.19.1-alpha.12

3 years ago

0.19.1-alpha.11

3 years ago

0.19.1-alpha.37

3 years ago

0.19.1-alpha.39

3 years ago

0.19.1-alpha.9

3 years ago

0.19.1-alpha.31

3 years ago

0.19.1-alpha.7

3 years ago

0.19.1-alpha.33

3 years ago

0.19.1-alpha.36

3 years ago

0.18.3-alpha.31

3 years ago

0.18.3-alpha.32

3 years ago

0.18.3-alpha.28

3 years ago

0.18.3-alpha.20

3 years ago

0.18.3-alpha.23

3 years ago

0.18.3-alpha.25

3 years ago

0.18.3-alpha.18

3 years ago

0.18.3-alpha.16

3 years ago

0.18.3-alpha.14

3 years ago

0.18.3-alpha.10

3 years ago

0.18.3-alpha.11

3 years ago

0.18.3-alpha.12

3 years ago

0.18.3-alpha.7

3 years ago

0.18.3-alpha.5

3 years ago

0.18.3-alpha.4

3 years ago

0.18.3-alpha.3

3 years ago

0.18.2-alpha.1

3 years ago

0.18.2

3 years ago

0.18.3-alpha.2

3 years ago

0.18.3-alpha.1

3 years ago

0.18.2-alpha.81

3 years ago

0.18.1

3 years ago

0.18.1-alpha.26

3 years ago

0.18.1-alpha.20

3 years ago

0.18.1-alpha.24

3 years ago

0.18.1-alpha.23

3 years ago

0.18.1-alpha.21

3 years ago

0.18.1-alpha.15

3 years ago

0.18.1-alpha.3

3 years ago

0.18.1-alpha.12

3 years ago

0.18.0

3 years ago

0.17.1-alpha.10

3 years ago

0.17.1-alpha.8

3 years ago

0.17.1-alpha.5

3 years ago

0.17.1-alpha.2

3 years ago

0.17.0

3 years ago

0.17.1-alpha.21

3 years ago

0.16.1-alpha.20

3 years ago

0.16.1-alpha.18

3 years ago

0.16.1-alpha.14

3 years ago

0.16.1-alpha.15

3 years ago

0.16.1-alpha.10

3 years ago

0.16.1-alpha.11

3 years ago

0.16.0

3 years ago

0.15.0

3 years ago

0.14.0

3 years ago

0.13.0

3 years ago

0.12.1-alpha.7

4 years ago

0.12.1-alpha.54

4 years ago

0.12.0

4 years ago

0.11.1-alpha.53

4 years ago

0.11.1-alpha.44

4 years ago

0.11.1-alpha.35

4 years ago

0.11.1-alpha.36

4 years ago

0.11.1-alpha.15

4 years ago

0.11.1-alpha.48

4 years ago

0.11.0

4 years ago

0.10.3-alpha.41

4 years ago

0.10.3-alpha.40

4 years ago

0.10.3-alpha.35

4 years ago

0.10.3-alpha.34

4 years ago

0.10.3-alpha.28

4 years ago