|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * observability/otel/otel-collector/otel-collector-exporters.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: REFERENCE |
| 6 | +[id="otel-exporters-google-cloud-exporter_{context}"] |
| 7 | += Google Cloud Exporter |
| 8 | + |
| 9 | +[role="_abstract"] |
| 10 | +You can use the Google Cloud Exporter to export telemetry data to Google Cloud Operations Suite. Using the Google Cloud Exporter, you can export metrics to Google Cloud Monitoring, logs to Google Cloud Logging, and traces to Google Cloud Trace. |
| 11 | + |
| 12 | +:FeatureName: The Google Cloud Exporter |
| 13 | +include::snippets/technology-preview.adoc[] |
| 14 | + |
| 15 | +.OpenTelemetry Collector custom resource with the enabled Google Cloud Exporter |
| 16 | +[source,yaml] |
| 17 | +---- |
| 18 | +# ... |
| 19 | + env: |
| 20 | + - name: GOOGLE_APPLICATION_CREDENTIALS |
| 21 | + value: /var/secrets/google/key.json # <1> |
| 22 | + volumeMounts: |
| 23 | + - name: google-application-credentials |
| 24 | + mountPath: /var/secrets/google |
| 25 | + readOnly: true |
| 26 | + volumes: |
| 27 | + - name: google-application-credentials |
| 28 | + secret: |
| 29 | + secretName: google-application-credentials |
| 30 | + config: |
| 31 | + exporters: |
| 32 | + googlecloud: |
| 33 | + project: # <2> |
| 34 | +# ... |
| 35 | +---- |
| 36 | +<1> The `GOOGLE_APPLICATION_CREDENTIALS` environment variable that points to the authentication `key.json` file. The `key.json` file is mounted as a secret volume to the OpenTelemetry Collector. |
| 37 | +<2> Optional project identifier. If not specified, the project is automatically determined from the credentials. |
| 38 | ++ |
| 39 | +By default, the exporter sends telemetry data to the project specified in the `project` field of the exporter's configuration. You can have an override set up on a per-metric basis by using the `gcp.project.id` resource attribute. For example, if a metric has a label project, you can use the Group-by-Attributes Processor to promote it to a resource label, and then use the Resource Processor to rename the attribute from `project` to `gcp.project.id`. |
| 40 | + |
| 41 | +[role="_additional-resources"] |
| 42 | +.Additional resources |
| 43 | +* link:https://cloud.google.com/monitoring[Google Cloud Monitoring] |
| 44 | +* link:https://cloud.google.com/logging[Google Cloud Logging] |
| 45 | +* link:https://cloud.google.com/trace[Google Cloud Trace] |
| 46 | +* link:https://cloud.google.com/iam/docs/workload-identity-federation-with-kubernetes#deploy[Google Cloud Guides: Configure Workload Identity Federation with Kubernetes] |
0 commit comments