Skip to content

Commit 0b2a8e0

Browse files
committed
chore: update readme for aws resource detector
Update README of AWS Resource Detector to clarify the source of the data. Part Of #2055 Signed-off-by: maryliag <[email protected]>
1 parent aed0f0f commit 0b2a8e0

File tree

1 file changed

+74
-5
lines changed
  • detectors/node/opentelemetry-resource-detector-aws

1 file changed

+74
-5
lines changed

detectors/node/opentelemetry-resource-detector-aws/README.md

Lines changed: 74 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,83 @@ const tracerProvider = new NodeTracerProvider({ resource });
3333

3434
## Available detectors
3535

36-
- `awsBeanstalkDetector`: Populates `service` for processes running on [AWS Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/)
37-
- `awsEc2Detector`: Populates `cloud` and `host` for processes running on [Amazon EC2](https://aws.amazon.com/ec2/), including abstractions such as ECS on EC2. Notably, it does not populate anything on AWS Fargate
38-
- `awsEcsDetector`: Populates `container` for containers running on [Amazon ECS](https://aws.amazon.com/ecs/)
39-
- `awsEksDetector`: Populates `container` and `k8s.cluster_name` for containers running on [Amazon EKS](https://aws.amazon.com/eks/)
36+
### Aws Beanstalk Detector
37+
38+
Populates `service` for processes running on [AWS Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/)
39+
40+
| Resource Attribute | Description |
41+
|---------------------|--------------------------------------------------------------------------|
42+
| cloud.provider | The cloud provider. In this context, it's always "aws" |
43+
| cloud.platform | The cloud platform. In this context, it's always "aws_elastic_beanstalk" |
44+
| service.instance.id | Value of `deployment_id` from config file `environment.conf` |
45+
| service.name | The service name. In this context, it's always "aws_elastic_beanstalk" |
46+
| service.namespace | Value of `environment_name` from config file `environment.conf` |
47+
| service.version | Value of `version_label` from config file `environment.conf` |
48+
49+
### AWS Ec2 Detector
50+
51+
Populates `cloud` and `host` for processes running on [Amazon EC2](https://aws.amazon.com/ec2/), including abstractions such as ECS on EC2. Notably, it does not populate anything on AWS Fargate.
52+
53+
| Resource Attribute | Description |
54+
|-------------------------|---------------------------------------------------------------------------------------|
55+
| cloud.account.id | Value of `accountId` from `/latest/dynamic/instance-identity/document` request |
56+
| cloud.availability_zone | Value of `availabilityZone` from `/latest/dynamic/instance-identity/document` request |
57+
| cloud.provider | The cloud provider. In this context, it's always "aws" |
58+
| cloud.platform | The cloud platform. In this context, it's always "aws_ec2" |
59+
| cloud.region | Value of `region` from `/latest/dynamic/instance-identity/document` request |
60+
| host.id | Value of `instanceId` from `/latest/dynamic/instance-identity/document` request |
61+
| host.name | Value of `hostname` from `/latest/dynamic/instance-identity/document` request |
62+
| host.type | Value of `instanceType` from `/latest/dynamic/instance-identity/document` request |
63+
64+
### AWS Ecs Detector
65+
66+
Populates `container` for containers running on [Amazon ECS](https://aws.amazon.com/ecs/).
67+
68+
| Resource Attribute | Description |
69+
|-------------------------|----------------------------------------------------------------------------------------|
70+
| aws.ecs.container.arn | Value of `ContainerARN` from the request to the metadata Uri. The Metadata Uri is stored on the Environment Variable `ECS_CONTAINER_METADATA_URI_V4` |
71+
| aws.ecs.cluster.arn | Value 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 |
72+
| aws.ecs.launchtype | Value of `LaunchType` from `ECS_CONTAINER_METADATA_URI_V4/task` request |
73+
| aws.ecs.task.arn | Value of `TaskARN` from `ECS_CONTAINER_METADATA_URI_V4/task` request |
74+
| aws.ecs.task.family | Value of `Family` from `ECS_CONTAINER_METADATA_URI_V4/task` request |
75+
| aws.ecs.task.revision | Value of `Revision` from `ECS_CONTAINER_METADATA_URI_V4/task` request |
76+
| aws.log.group.arns | Value 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 |
77+
| aws.log.group.names | Value of `awslogs-group` from logs metadata. Logs metadata values come from `LogOptions` on `ECS_CONTAINER_METADATA_URI_V4` request |
78+
| aws.log.stream.arns | Value 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` |
79+
| aws.log.stream.names | Value of `awslogs-stream` from logs metadata |
80+
| cloud.account.id | Parsed value from the `TaskARN` |
81+
| cloud.availability_zone | Value of `AvailabilityZone` from `ECS_CONTAINER_METADATA_URI_V4/task` request. This value is not available in all Fargate runtimes |
82+
| cloud.platform | The cloud platform. In this context, it's always "aws_ecs" |
83+
| cloud.provider | The cloud provider. In this context, it's always "aws" |
84+
| cloud.region | Parsed value from the `TaskARN` |
85+
| container.id | Value of from file `/proc/self/cgroup` |
86+
| container.name | The hostname of the operating system |
87+
88+
### AWS Eks Detector
89+
90+
Populates `container` and `k8s.cluster_name` for containers running on [Amazon EKS](https://aws.amazon.com/eks/).
4091
- `k8s.cluster_name` is not always available depending on the configuration of CloudWatch monitoring for the EKS cluster
41-
- `awsLambdaDetector`: Populates `faas` and `cloud` for functions running on [AWS Lambda](https://aws.amazon.com/lambda/)
92+
93+
| Resource Attribute | Description |
94+
|--------------------|---------------------------------------------------------------------------------------|
95+
| cloud.provider | The cloud provider. In this context, it's always "aws" |
96+
| cloud.platform | The cloud platform. In this context, it's always "aws_eks" |
97+
| container.id | Value from config file `/proc/self/cgroup` |
98+
| k8s.cluster.name | Value of `cluster.name` from `/api/v1/namespaces/amazon-cloudwatch/configmaps/cluster-info` request |
99+
100+
### AWS Lambda Detector
101+
102+
Populates `faas` and `cloud` for functions running on [AWS Lambda](https://aws.amazon.com/lambda/).
42103
- `faas.id` is currently not populated as it is not provided by the runtime at startup
43104

105+
| Resource Attribute | Description |
106+
|--------------------|---------------------------------------------------------------------|
107+
| cloud.provider | The cloud provider. In this context, it's always "aws" |
108+
| cloud.platform | The cloud platform. In this context, it's always "aws_lambda" |
109+
| cloud.region | Value of Process Environment Variable `AWS_REGION` |
110+
| faas.name | Value of Process Environment Variable `AWS_LAMBDA_FUNCTION_NAME` |
111+
| faas.version | Value of Process Environment Variable `AWS_LAMBDA_FUNCTION_VERSION` |
112+
44113
## Useful links
45114

46115
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>

0 commit comments

Comments
 (0)