Skip to content

Commit

Permalink
chore: update readme for gcp resource detector
Browse files Browse the repository at this point in the history
Update README of GCP Resource Detector to clarify the source of the data and add semantic conventions.

Part Of #2055
Part Of #2025

Signed-off-by: maryliag <[email protected]>
  • Loading branch information
maryliag committed Apr 3, 2024
1 parent 8c6ba2c commit 45ec21b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions detectors/node/opentelemetry-resource-detector-gcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,24 @@ const resource = await detectResources({
const tracerProvider = new NodeTracerProvider({ resource });
```

## Available detectors & Semantic Conventions

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)

### GCP Detector

| Resource Attribute | Description | Notes |
|-------------------------|---------------------------------------------------------------| ------------------------------------------ |
| cloud.account.id | Value of `project-id` from GCP Metadata project | Key: `SEMRESATTRS_CLOUD_ACCOUNT_ID` |
| cloud.availability_zone | Value of `zone` from GCP Metadata instance | Key: `SEMRESATTRS_CLOUD_AVAILABILITY_ZONE` |
| cloud.provider | The cloud provider. In this context, it's always "gcp" | Key: `SEMRESATTRS_CLOUD_PROVIDER` |
| container.name | Value of Environment Variable `CONTAINER_NAME` | Key: `SEMRESATTRS_CONTAINER_NAME` |
| host.id | Value of `id` from GCP Metadata instance | Key: `SEMRESATTRS_HOST_ID` |
| host.name | Value of `hostname` from GCP Metadata instance | Key: `SEMRESATTRS_HOST_NAME` |
| k8s.cluster.name | Value of `attributes/cluster-name` from GCP Metadata instance | Key: `SEMRESATTRS_K8S_CLUSTER_NAME` |
| k8s.namespace.name | Value of Environment Variable `NAMESPACE` | Key: `SEMRESATTRS_K8S_NAMESPACE_NAME` |
| k8s.pod.name | Value of Environment Variable `HOSTNAME` | Key: `SEMRESATTRS_K8S_POD_NAME` |

## Useful links

- [GCP Metadata Documentation][]
Expand Down

0 comments on commit 45ec21b

Please sign in to comment.