Skip to content

Commit 1773b66

Browse files
authored
[chore] Reference documentation.md for resource attributes per resource detector (open-telemetry#35737)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This PR fixes the issue described at open-telemetry#34210. Each detector's docs should list the resource attributes as they are defined by the `metadata.yml` files. This PR links each detector to its `documentation.md` as a reference for the respective Resource Atrributes. <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#34210 <!--Describe what testing was performed and which tests were added.--> #### Testing ~ <!--Describe the documentation added.--> #### Documentation Added <!--Please delete paragraphs that you did not use before submitting.--> Signed-off-by: ChrsMark <[email protected]>
1 parent c113bb7 commit 1773b66

File tree

1 file changed

+29
-117
lines changed
  • processor/resourcedetectionprocessor

1 file changed

+29
-117
lines changed

processor/resourcedetectionprocessor/README.md

Lines changed: 29 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,8 @@ processors:
3939
4040
Note: use the Docker detector (see below) if running the Collector as a Docker container.
4141
42-
Queries the host machine to retrieve the following resource attributes:
43-
44-
* host.arch
45-
* host.name
46-
* host.id
47-
* host.ip
48-
* host.mac
49-
* host.cpu.vendor.id
50-
* host.cpu.family
51-
* host.cpu.model.id
52-
* host.cpu.model.name
53-
* host.cpu.stepping
54-
* host.cpu.cache.l2.size
55-
* os.description
56-
* os.type
42+
Queries the host machine to retrieve the system related resource attributes. The list of the
43+
populated resource attributes can be found at [System Detector Resource Attributes](./internal/system/documentation.md).
5744
5845
By default `host.name` is being set to FQDN if possible, and a hostname provided by OS used as fallback.
5946
This logic can be changed with `hostname_sources` configuration which is set to `["dns", "os"]` by default.
@@ -98,10 +85,9 @@ The "lookup" hostname source does a reverse DNS lookup of the current host's IP
9885

9986
### Docker metadata
10087

101-
Queries the Docker daemon to retrieve the following resource attributes from the host machine:
102-
103-
* host.name
104-
* os.type
88+
Queries the Docker daemon to retrieve resource attributes from the host machine.
89+
The list of the populated resource attributes can
90+
be found at [Docker Detector Resource Attributes](./internal/docker/documentation.md).
10591

10692
You need to mount the Docker socket (`/var/run/docker.sock` on Linux) to contact the Docker daemon.
10793
Docker detection does not work on macOS.
@@ -133,6 +119,8 @@ We map these environment variables to resource attributes as follows:
133119

134120
For more information, see the [Heroku cloud provider documentation](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/resource/cloud-provider/heroku.md) under the [OpenTelemetry specification semantic conventions](https://github.com/open-telemetry/semantic-conventions).
135121

122+
The list of the populated resource attributes can be found at [Heroku Detector Resource Attributes](./internal/heroku/documentation.md).
123+
136124
```yaml
137125
processors:
138126
resourcedetection/heroku:
@@ -158,6 +146,8 @@ processors:
158146
override: false
159147
```
160148

149+
The list of the populated resource attributes can be found at [GCP Detector Resource Attributes](./internal/gcp/documentation.md).
150+
161151
#### GCE Metadata
162152

163153
* cloud.provider ("gcp")
@@ -231,17 +221,10 @@ able to determine `host.name`. In that case, users are encouraged to set `host.n
231221

232222
### AWS EC2
233223

234-
Uses [AWS SDK for Go](https://docs.aws.amazon.com/sdk-for-go/api/aws/ec2metadata/) to read resource information from the [EC2 instance metadata API](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) to retrieve the following resource attributes:
224+
Uses [AWS SDK for Go](https://docs.aws.amazon.com/sdk-for-go/api/aws/ec2metadata/) to read resource information
225+
from the [EC2 instance metadata API](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) to retrieve related resource attributes:
235226

236-
* cloud.provider ("aws")
237-
* cloud.platform ("aws_ec2")
238-
* cloud.account.id
239-
* cloud.region
240-
* cloud.availability_zone
241-
* host.id
242-
* host.image.id
243-
* host.name
244-
* host.type
227+
The list of the populated resource attributes can be found at [EC2 Detector Resource Attributes](./internal/aws/ec2/documentation.md).
245228

246229
It also can optionally gather tags for the EC2 instance that the collector is running on.
247230
Note that in order to fetch EC2 tags, the IAM role assigned to the EC2 instance must have a policy that includes the `ec2:DescribeTags` permission.
@@ -267,21 +250,7 @@ If the instance is part of AWS ParallelCluster and the detector is failing to co
267250

268251
Queries the [Task Metadata Endpoint](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-metadata-endpoint.html) (TMDE) to record information about the current ECS Task. Only TMDE V4 and V3 are supported.
269252

270-
* cloud.provider ("aws")
271-
* cloud.platform ("aws_ecs")
272-
* cloud.account.id
273-
* cloud.region
274-
* cloud.availability_zone
275-
* aws.ecs.cluster.arn
276-
* aws.ecs.task.arn
277-
* aws.ecs.task.family
278-
* aws.ecs.task.id
279-
* aws.ecs.task.revision
280-
* aws.ecs.launchtype (V4 only)
281-
* aws.log.group.names (V4 only)
282-
* aws.log.group.arns (V4 only)
283-
* aws.log.stream.names (V4 only)
284-
* aws.log.stream.arns (V4 only)
253+
The list of the populated resource attributes can be found at [ECS Detector Resource Attributes](./internal/aws/ecs/documentation.md).
285254

286255
Example:
287256

@@ -297,11 +266,7 @@ processors:
297266

298267
Reads the AWS X-Ray configuration file available on all Beanstalk instances with [X-Ray Enabled](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-configuration-debugging.html).
299268

300-
* cloud.provider ("aws")
301-
* cloud.platform ("aws_elastic_beanstalk")
302-
* deployment.environment
303-
* service.instance.id
304-
* service.version
269+
The list of the populated resource attributes can be found at [Elastic Beanstalk Detector Resource Attributes](./internal/aws/elasticbeanstalk/documentation.md).
305270

306271
Example:
307272

@@ -315,9 +280,7 @@ processors:
315280

316281
### Amazon EKS
317282

318-
* cloud.provider ("aws")
319-
* cloud.platform ("aws_eks")
320-
* k8s.cluster.name
283+
The list of the populated resource attributes can be found at [EKS Detector Resource Attributes](./internal/aws/eks/documentation.md).
321284

322285
Example:
323286

@@ -352,26 +315,9 @@ If you see an error with the message `context deadline exceeded`, please increas
352315
### AWS Lambda
353316

354317
Uses the AWS Lambda [runtime environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime)
355-
to retrieve the following resource attributes:
356-
357-
[Cloud semantic conventions](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/resource/cloud.md)
358-
359-
* `cloud.provider` (`"aws"`)
360-
* `cloud.platform` (`"aws_lambda"`)
361-
* `cloud.region` (`$AWS_REGION`)
318+
to retrieve related resource attributes.
362319

363-
[Function as a Service semantic conventions](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/resource/faas.md)
364-
and [AWS Lambda semantic conventions](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/faas/aws-lambda.md)
365-
366-
* `faas.name` (`$AWS_LAMBDA_FUNCTION_NAME`)
367-
* `faas.version` (`$AWS_LAMBDA_FUNCTION_VERSION`)
368-
* `faas.instance` (`$AWS_LAMBDA_LOG_STREAM_NAME`)
369-
* `faas.max_memory` (`$AWS_LAMBDA_FUNCTION_MEMORY_SIZE`)
370-
371-
[AWS Logs semantic conventions](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/resource/cloud-provider/aws/logs.md)
372-
373-
* `aws.log.group.names` (`$AWS_LAMBDA_LOG_GROUP_NAME`)
374-
* `aws.log.stream.names` (`$AWS_LAMBDA_LOG_STREAM_NAME`)
320+
The list of the populated resource attributes can be found at [Lambda Detector Resource Attributes](./internal/aws/lambda/documentation.md).
375321

376322
Example:
377323

@@ -385,18 +331,9 @@ processors:
385331

386332
### Azure
387333

388-
Queries the [Azure Instance Metadata Service](https://aka.ms/azureimds) to retrieve the following resource attributes:
334+
Queries the [Azure Instance Metadata Service](https://aka.ms/azureimds) to retrieve related attributes.
389335

390-
* cloud.provider ("azure")
391-
* cloud.platform ("azure_vm")
392-
* cloud.region
393-
* cloud.account.id (subscription ID)
394-
* host.id (virtual machine ID)
395-
* host.name
396-
* azure.vm.name (same as host.name)
397-
* azure.vm.size (virtual machine size)
398-
* azure.vm.scaleset.name (name of the scale set if any)
399-
* azure.resourcegroup.name (resource group name)
336+
The list of the populated resource attributes can be found at [Azure Detector Resource Attributes](./internal/azure/documentation.md).
400337

401338
Example:
402339

@@ -430,9 +367,7 @@ Matched tags are added as:
430367

431368
### Azure AKS
432369

433-
* cloud.provider ("azure")
434-
* cloud.platform ("azure_aks")
435-
* k8s.cluster.name
370+
The list of the populated resource attributes can be found at [AKS Detector Resource Attributes](./internal/azure/aks/documentation.md).
436371

437372
```yaml
438373
processors:
@@ -473,11 +408,12 @@ If accurate parsing cannot be performed, the infrastructure resource group value
473408

474409
### Consul
475410

476-
Queries a [consul agent](https://www.consul.io/docs/agent) and reads its' [configuration endpoint](https://www.consul.io/api-docs/agent#read-configuration) to retrieve the following resource attributes:
411+
Queries a [consul agent](https://www.consul.io/docs/agent) and reads its' [configuration endpoint](https://www.consul.io/api-docs/agent#read-configuration) to retrieve related resource attributes:
412+
413+
The list of the populated resource attributes can be found at [Consul Detector Resource Attributes](./internal/consul/documentation.md).
414+
415+
In addition to:
477416

478-
* cloud.region (consul datacenter)
479-
* host.id (consul node id)
480-
* host.name (consul node name)
481417
* *exploded consul metadata* - reads all key:value pairs in [consul metadata](https://www.consul.io/docs/agent/options#_node_meta) into label:labelvalue pairs.
482418

483419
```yaml
@@ -488,32 +424,11 @@ processors:
488424
override: false
489425
```
490426

491-
### Heroku
492-
493-
** You must first enable the [Heroku metadata feature](https://devcenter.heroku.com/articles/dyno-metadata) on the application **
494-
495-
Queries [Heroku metadata](https://devcenter.heroku.com/articles/dyno-metadata) to retrieve the following resource attributes:
496-
497-
* heroku.release.version (identifier for the current release)
498-
* heroku.release.creation_timestamp (time and date the release was created)
499-
* heroku.release.commit (commit hash for the current release)
500-
* heroku.app.name (application name)
501-
* heroku.app.id (unique identifier for the application)
502-
* heroku.dyno.id (dyno identifier. Used as host name)
503-
504-
```yaml
505-
processors:
506-
resourcedetection/heroku:
507-
detectors: [env, heroku]
508-
timeout: 2s
509-
override: false
510-
```
511-
512427
### K8S Node Metadata
513428

514-
Queries the K8S api server to retrieve the following node resource attributes:
429+
Queries the K8S api server to retrieve node resource attributes.
515430

516-
* k8s.node.uid
431+
The list of the populated resource attributes can be found at [k8snode Detector Resource Attributes](./internal/k8snode/documentation.md).
517432

518433
The following permissions are required:
519434
```yaml
@@ -566,12 +481,9 @@ and add this to your workload:
566481

567482
### Openshift
568483

569-
Queries the OpenShift and Kubernetes API to retrieve the following resource attributes:
484+
Queries the OpenShift and Kubernetes API to retrieve related resource attributes.
570485

571-
* cloud.provider
572-
* cloud.platform
573-
* cloud.region
574-
* k8s.cluster.name
486+
The list of the populated resource attributes can be found at [Openshift Detector Resource Attributes](./internal/openshift/documentation.md).
575487

576488
The following permissions are required:
577489
```yaml

0 commit comments

Comments
 (0)