Skip to content

Commit

Permalink
Update gcp documentation (open-telemetry#30929)
Browse files Browse the repository at this point in the history
Fixes
open-telemetry#26649
Fixes
open-telemetry#27803

---------

Co-authored-by: Curtis Robert <crobert@splunk.com>
  • Loading branch information
2 people authored and cparkins committed Feb 1, 2024
1 parent 4eac33f commit 142c1e9
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions exporter/googlecloudexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,34 @@ following proxy environment variables:
If set at Collector start time then exporters, regardless of protocol,
will or will not proxy traffic as defined by these environment variables.

### Monitored Resources

For metrics and logs, this exporter maps the OpenTelemetry Resource to a Google
Cloud [Logging\(https://cloud.google.com/logging/docs/api/v2/resource-list) or
[Monitoring](https://cloud.google.com/monitoring/api/resources) Monitored Resource.

The complete mapping logic can be found [here](https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/main/internal/resourcemapping/resourcemapping.go).
That may be the most helpful reference if you want to map to a specific monitored
resource.

#### On GCP

If running on GCP, using the GCP resource detector, as shown above, will populate
the resource attributes required to map to the appropriate monitored resource.

#### Off GCP

If you are not running on GCP, you still need to choose a [GCP zone or
region](https://cloud.google.com/compute/docs/regions-zones) to send telemetry to
by setting `cloud.availability_zone` or `cloud.region`. In addition, you should use the detector associated with other cloud providers, if applicable.

If running on Kubernetes, it is recommended to additionally set `k8s.pod.name`,
`k8s.namespace.name`, and `k8s.container.name` using the `k8sattributes` processor.

If you are getting "duplicate timeseries encountered" errors, it is likely because
you are missing a required resource attribute, causing a metric from two different
instances of an application to end up with the same monitored resource.

### Preventing metric label collisions

The metrics exporter can add metric labels to timeseries, such as when setting
Expand Down Expand Up @@ -274,6 +302,9 @@ processors:
- delete_key(attributes, "instrumentation_version")
```

**Note** It is not recommended to use these transformations with the googlecloud
exporter in a logging or trace pipeline.

The same method can be used for any resource attributes being filtered to metric
labels, or metric labels which might collide with the GCP monitored resource
used with resource detection.
Expand Down

0 comments on commit 142c1e9

Please sign in to comment.