From 35a102418d4567a41af2507690c6649faf8494e5 Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Tue, 23 Dec 2025 16:11:17 +0100 Subject: [PATCH 1/3] TRACING-5814 | RHOSDT 3.9 Document google managed prometheus Signed-off-by: Pavol Loffay --- ...ing-data-to-google-managed-prometheus.adoc | 55 +++++++++++++++++++ .../otel/otel-forwarding-telemetry-data.adoc | 2 + 2 files changed, 57 insertions(+) create mode 100644 modules/otel-forwarding-data-to-google-managed-prometheus.adoc diff --git a/modules/otel-forwarding-data-to-google-managed-prometheus.adoc b/modules/otel-forwarding-data-to-google-managed-prometheus.adoc new file mode 100644 index 000000000000..6d1e2fba2023 --- /dev/null +++ b/modules/otel-forwarding-data-to-google-managed-prometheus.adoc @@ -0,0 +1,55 @@ +// 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] +---- +# ... + config: + extensions: + file_storage/all_settings: + directory: /var/lib/otelcol/mydir # <1> + timeout: 1s # <2> + compaction: + on_start: true # <3> + directory: /tmp/ # <4> + max_transaction_size: 65_536 # <5> + fsync: false # <6> + processors: + 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") + + exporters: + otlp: + sending_queue: + storage: file_storage/all_settings # <7> + + service: + extensions: [file_storage/all_settings] # <8> + pipelines: + traces: + receivers: [otlp] + exporters: [otlp] +# ... diff --git a/observability/otel/otel-forwarding-telemetry-data.adoc b/observability/otel/otel-forwarding-telemetry-data.adoc index bf86771546c4..9bdb253582f5 100644 --- a/observability/otel/otel-forwarding-telemetry-data.adoc +++ b/observability/otel/otel-forwarding-telemetry-data.adoc @@ -26,6 +26,8 @@ include::modules/otel-forwarding-data-to-google-cloud.adoc[leveloffset=+1] .Additional resources * xref:../../observability/otel/otel-collector/otel-collector-exporters.adoc#otel-collector-exporters[Exporters] +include::modules/otel-forwarding-data-to-google-managed-prometheus.adoc[leveloffset=+1] + [role="_additional-resources"] [id="additional-resources_{context}"] == Additional resources From 4f37f2339074d00429de25c8b48f8bbdd12720fe Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Tue, 23 Dec 2025 16:38:32 +0100 Subject: [PATCH 2/3] TRACING-5814 | RHOSDT 3.9 Document google managed prometheus Signed-off-by: Pavol Loffay --- ...ing-data-to-google-managed-prometheus.adoc | 75 +++++++++++-------- .../otel/otel-forwarding-telemetry-data.adoc | 5 ++ 2 files changed, 48 insertions(+), 32 deletions(-) diff --git a/modules/otel-forwarding-data-to-google-managed-prometheus.adoc b/modules/otel-forwarding-data-to-google-managed-prometheus.adoc index 6d1e2fba2023..9f2a8981abe7 100644 --- a/modules/otel-forwarding-data-to-google-managed-prometheus.adoc +++ b/modules/otel-forwarding-data-to-google-managed-prometheus.adoc @@ -13,43 +13,54 @@ To forward metrics to the Google Managed Prometheus, use the OpenTelemetry Colle [source,yaml] ---- # ... + mode: sidecar config: extensions: - file_storage/all_settings: - directory: /var/lib/otelcol/mydir # <1> - timeout: 1s # <2> - compaction: - on_start: true # <3> - directory: /tmp/ # <4> - max_transaction_size: 65_536 # <5> - fsync: false # <6> - processors: - 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") + googleclientauth: {} exporters: - otlp: - sending_queue: - storage: file_storage/all_settings # <7> + 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: [file_storage/all_settings] # <8> + extensions: [googleclientauth] pipelines: - traces: - receivers: [otlp] - exporters: [otlp] + 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. +<2> Replace with your GCP project ID. \ No newline at end of file diff --git a/observability/otel/otel-forwarding-telemetry-data.adoc b/observability/otel/otel-forwarding-telemetry-data.adoc index 9bdb253582f5..7da16294b53a 100644 --- a/observability/otel/otel-forwarding-telemetry-data.adoc +++ b/observability/otel/otel-forwarding-telemetry-data.adoc @@ -28,6 +28,11 @@ include::modules/otel-forwarding-data-to-google-cloud.adoc[leveloffset=+1] include::modules/otel-forwarding-data-to-google-managed-prometheus.adoc[leveloffset=+1] +[role="_additional-resources"] +.Additional resources +* xref:../../observability/otel/otel-collector/otel-collector-processors.adoc#otel-collector-processors[Processors] +* xref:../../observability/otel/otel-collector/otel-collector-extensions.adoc#otel-collector-extensions[Extensions] + [role="_additional-resources"] [id="additional-resources_{context}"] == Additional resources From a08a279faedc02a7cff26884ff3ab9a1b0915ddd Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Tue, 23 Dec 2025 17:19:58 +0100 Subject: [PATCH 3/3] Google link Signed-off-by: Pavol Loffay --- observability/otel/otel-forwarding-telemetry-data.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/observability/otel/otel-forwarding-telemetry-data.adoc b/observability/otel/otel-forwarding-telemetry-data.adoc index 7da16294b53a..e4cb6a372768 100644 --- a/observability/otel/otel-forwarding-telemetry-data.adoc +++ b/observability/otel/otel-forwarding-telemetry-data.adoc @@ -32,6 +32,7 @@ include::modules/otel-forwarding-data-to-google-managed-prometheus.adoc[leveloff .Additional resources * xref:../../observability/otel/otel-collector/otel-collector-processors.adoc#otel-collector-processors[Processors] * xref:../../observability/otel/otel-collector/otel-collector-extensions.adoc#otel-collector-extensions[Extensions] +* https://docs.cloud.google.com/stackdriver/docs/managed-prometheus [role="_additional-resources"] [id="additional-resources_{context}"]