-
Notifications
You must be signed in to change notification settings - Fork 1.9k
TRACING-5814 | RHOSDT 3.9 Document google managed prometheus #104286
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
Closed
pavolloffay
wants to merge
7
commits into
openshift:main
from
pavolloffay:rhosdt-3.9-google-managed-prometheus
Closed
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
35a1024
TRACING-5814 | RHOSDT 3.9 Document google managed prometheus
pavolloffay 4f37f23
TRACING-5814 | RHOSDT 3.9 Document google managed prometheus
pavolloffay a08a279
Google link
pavolloffay da06f79
Add google auth extension
pavolloffay c20634e
Use WIF
pavolloffay 5c73d11
Use WIF
pavolloffay 725d3af
Use WIF
pavolloffay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
modules/otel-forwarding-data-to-google-managed-prometheus.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * observability/otel/otel-forwarding-telemetry-data.adoc | ||
|
|
||
| :_mod-docs-content-type: CONCEPT | ||
| [id="otel-forwarding-data-to-google-managed-prometheus_{context}"] | ||
| = Forwarding telemetry data to Google Managed Prometheus | ||
|
|
||
| [role="_abstract"] | ||
| To forward metrics to the Google Managed Prometheus, use the OpenTelemetry Collector with the OTLP exporter, metricstarttime processor and googleclientauth extension. | ||
|
|
||
| .OpenTelemetry Collector custom resource with a configured File Storage Extension that persists an OTLP sending queue | ||
| [source,yaml] | ||
| ---- | ||
| # ... | ||
| mode: sidecar | ||
| config: | ||
| extensions: | ||
| googleclientauth: {} | ||
|
|
||
| exporters: | ||
| otlphttp: | ||
| encoding: json | ||
| endpoint: https://telemetry.googleapis.com | ||
| auth: | ||
| authenticator: googleclientauth | ||
|
|
||
| processors: | ||
| metricstarttime: | ||
| strategy: subtract_initial_point # <2> | ||
|
|
||
| resource/gcp_project_id: | ||
| attributes: | ||
| - action: insert | ||
| value: project_id # <1> | ||
| key: gcp.project_id | ||
|
|
||
| k8sattributes: {} | ||
|
|
||
| transform/collision: | ||
| metric_statements: | ||
| - context: datapoint | ||
| statements: | ||
| - set(attributes["exported_location"], attributes["location"]) | ||
| - delete_key(attributes, "location") | ||
| - set(attributes["exported_cluster"], attributes["cluster"]) | ||
| - delete_key(attributes, "cluster") | ||
| - set(attributes["exported_namespace"], attributes["namespace"]) | ||
| - delete_key(attributes, "namespace") | ||
| - set(attributes["exported_job"], attributes["job"]) | ||
| - delete_key(attributes, "job") | ||
| - set(attributes["exported_instance"], attributes["instance"]) | ||
| - delete_key(attributes, "instance") | ||
| - set(attributes["exported_project_id"], attributes["project_id"]) | ||
| - delete_key(attributes, "project_id") | ||
|
|
||
| service: | ||
| extensions: [googleclientauth] | ||
| pipelines: | ||
| metrics: | ||
| processors: [k8sattributes, resource/gcp_project_id, transform/collision, metricstarttime] | ||
| exporters: [otlphttp] | ||
| # ... | ||
| ---- | ||
| <1> The `subtract_initial_point` strategy is stateful, requiring the Collector to run as a sidecar to maintain per-pod state. Alternative strategies available; choose the one that best fits your use case. | ||
|
max-cx marked this conversation as resolved.
Outdated
|
||
| <2> Replace with your GCP project ID. | ||
|
max-cx marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IshwarKanse the enxtension has a project parameter
https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/googleclientauthextension
what do they mean by this? In OCP context, can it be only specified in
GOOGLE_APPLICATION_CREDENTIALS?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Application Default Credentials (ADC) is Google's credential discovery mechanism that searches for credentials in this order:
In the OpenShift/Kubernetes context, GOOGLE_APPLICATION_CREDENTIALS is the standard approach, even when running on Google Cloud, because:
The GOOGLE_APPLICATION_CREDENTIALS env var should point to one of these credential types:
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: "/etc/google-cloud-sa/sa-key.json"
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: "/etc/workload-identity/credential-configuration.json"
About the project parameter
When we set project in the extension config, it's actually optional because:
For the documentation, I'd suggest making the project parameter optional and explaining that users can omit it if they're already setting the resource attribute or if they want ADC to auto-detect it from the credentials.