Skip to content

Commit 69e8077

Browse files
authored
docs(resource-detector-aws): update readme for aws resource detector (#2060)
Refs: #2055 Signed-off-by: maryliag <[email protected]>
1 parent 10c0c93 commit 69e8077

File tree

1 file changed

+78
-7
lines changed
  • detectors/node/opentelemetry-resource-detector-aws

1 file changed

+78
-7
lines changed

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

Lines changed: 78 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,84 @@ 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/)
40-
- `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/)
42-
- `faas.id` is currently not populated as it is not provided by the runtime at startup
36+
This package uses `@opentelemetry/semantic-conventions` version `1.22+`, which implements Semantic Convention [Version 1.7.0](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/semantic_conventions/README.md)
37+
38+
### AWS Beanstalk Detector
39+
40+
Populates `service` for processes running on [AWS Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/)
41+
42+
| Resource Attribute | Description |
43+
|---------------------|--------------------------------------------------------------------------|
44+
| cloud.platform | The cloud platform. In this context, it's always "aws_elastic_beanstalk" |
45+
| cloud.provider | The cloud provider. In this context, it's always "aws" |
46+
| service.instance.id | Value of `deployment_id` from config file `environment.conf` |
47+
| service.name | The service name. In this context, it's always "aws_elastic_beanstalk" |
48+
| service.namespace | Value of `environment_name` from config file `environment.conf` |
49+
| service.version | Value of `version_label` from config file `environment.conf` |
50+
51+
### AWS EC2 Detector
52+
53+
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.
54+
55+
| Resource Attribute | Description |
56+
|-------------------------|---------------------------------------------------------------------------------------|
57+
| cloud.account.id | Value of `accountId` from `/latest/dynamic/instance-identity/document` request |
58+
| cloud.availability_zone | Value of `availabilityZone` from `/latest/dynamic/instance-identity/document` request |
59+
| cloud.platform | The cloud platform. In this context, it's always "aws_ec2" |
60+
| cloud.provider | The cloud provider. In this context, it's always "aws" |
61+
| cloud.region | Value of `region` from `/latest/dynamic/instance-identity/document` request |
62+
| host.id | Value of `instanceId` from `/latest/dynamic/instance-identity/document` request |
63+
| host.name | Value of `hostname` from `/latest/dynamic/instance-identity/document` request |
64+
| host.type | Value of `instanceType` from `/latest/dynamic/instance-identity/document` request |
65+
66+
### AWS ECS Detector
67+
68+
Populates `container` for containers running on [Amazon ECS](https://aws.amazon.com/ecs/).
69+
70+
| Resource Attribute | Description |
71+
|-------------------------|----------------------------------------------------------------------------------------|
72+
| 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` |
73+
| 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 |
74+
| aws.ecs.launchtype | Value of `LaunchType` from `ECS_CONTAINER_METADATA_URI_V4/task` request |
75+
| aws.ecs.task.arn | Value of `TaskARN` from `ECS_CONTAINER_METADATA_URI_V4/task` request |
76+
| aws.ecs.task.family | Value of `Family` from `ECS_CONTAINER_METADATA_URI_V4/task` request |
77+
| aws.ecs.task.revision | Value of `Revision` from `ECS_CONTAINER_METADATA_URI_V4/task` request |
78+
| 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 |
79+
| aws.log.group.names | Value of `awslogs-group` from logs metadata. Logs metadata values come from `LogOptions` on `ECS_CONTAINER_METADATA_URI_V4` request |
80+
| 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` |
81+
| aws.log.stream.names | Value of `awslogs-stream` from logs metadata |
82+
| cloud.account.id | Parsed value from the `TaskARN` |
83+
| cloud.availability_zone | Value of `AvailabilityZone` from `ECS_CONTAINER_METADATA_URI_V4/task` request. This value is not available in all Fargate runtimes |
84+
| cloud.platform | The cloud platform. In this context, it's always "aws_ecs" |
85+
| cloud.provider | The cloud provider. In this context, it's always "aws" |
86+
| cloud.region | Parsed value from the `TaskARN` |
87+
| container.id | Value of from file `/proc/self/cgroup` |
88+
| container.name | The hostname of the operating system |
89+
90+
### AWS EKS Detector
91+
92+
Populates `container` and `k8s.cluster_name` for containers running on [Amazon EKS](https://aws.amazon.com/eks/).
93+
`k8s.cluster_name` is not always available depending on the configuration of CloudWatch monitoring for the EKS cluster.
94+
95+
| Resource Attribute | Description |
96+
|--------------------|-----------------------------------------------------------------------------------------------------|
97+
| cloud.platform | The cloud platform. In this context, it's always "aws_eks" |
98+
| cloud.provider | The cloud provider. In this context, it's always "aws" |
99+
| container.id | Value from config file `/proc/self/cgroup` |
100+
| k8s.cluster.name | Value of `cluster.name` from `/api/v1/namespaces/amazon-cloudwatch/configmaps/cluster-info` request |
101+
102+
### AWS Lambda Detector
103+
104+
Populates `faas` and `cloud` for functions running on [AWS Lambda](https://aws.amazon.com/lambda/).
105+
`faas.id` is currently not populated as it is not provided by the runtime at startup.
106+
107+
| Resource Attribute | Description |
108+
|--------------------|---------------------------------------------------------------------|
109+
| cloud.platform | The cloud platform. In this context, it's always "aws_lambda" |
110+
| cloud.provider | The cloud provider. In this context, it's always "aws" |
111+
| cloud.region | Value of Process Environment Variable `AWS_REGION` |
112+
| faas.name | Value of Process Environment Variable `AWS_LAMBDA_FUNCTION_NAME` |
113+
| faas.version | Value of Process Environment Variable `AWS_LAMBDA_FUNCTION_VERSION` |
43114

44115
## Useful links
45116

0 commit comments

Comments
 (0)