Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gcp documentation #30929

Merged
merged 6 commits into from
Feb 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions exporter/googlecloudexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,30 @@ 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.

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.

**Note:** If you are not running on GCP, you still need to choose a [GCP zone or
dashpole marked this conversation as resolved.
Show resolved Hide resolved
region](https://cloud.google.com/compute/docs/regions-zones) to send telemetry to
by setting cloud.availability_zone or cloud.region.
dashpole marked this conversation as resolved.
Show resolved Hide resolved

If running on Kubernetes, it is recommended to additionally set k8s.pod.name,
dashpole marked this conversation as resolved.
Show resolved Hide resolved
`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 +298,9 @@ processors:
- delete_key(attributes, "instrumentation_version")
```

**Note** It is not recommended to use these transformations with the googlecloud
exporter in a logging pipeline.
dashpole marked this conversation as resolved.
Show resolved Hide resolved
dashpole marked this conversation as resolved.
Show resolved Hide resolved

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
Loading