From 56e1bd80793aeea26d5115b5de75418d739d904e Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Thu, 5 Dec 2024 21:14:21 +0000 Subject: [PATCH] double-write metrics to otlphttp exporter and googlemanagedprometheus --- gcp/opentelemetry-demo-features.yaml.gotmpl | 3 +++ src/otelcollector/otelcol-config-extras.yml | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/gcp/opentelemetry-demo-features.yaml.gotmpl b/gcp/opentelemetry-demo-features.yaml.gotmpl index bf6c4c24..cc344d29 100644 --- a/gcp/opentelemetry-demo-features.yaml.gotmpl +++ b/gcp/opentelemetry-demo-features.yaml.gotmpl @@ -62,4 +62,7 @@ opentelemetry-collector: traces: processors: [k8sattributes, memory_limiter, resourcedetection, resource, resource/gcp_project_id, batch] exporters: [otlphttp/gcp_auth] + metrics/otlp: + processors: [k8sattributes, memory_limiter, filter/currency, resourcedetection, transform/collision, resource, resource/gcp_project_id, transform/metricprefix, batch] + exporters: [otlphttp/gcp_auth] {{ end }} diff --git a/src/otelcollector/otelcol-config-extras.yml b/src/otelcollector/otelcol-config-extras.yml index a992cb11..aa5a623e 100644 --- a/src/otelcollector/otelcol-config-extras.yml +++ b/src/otelcollector/otelcol-config-extras.yml @@ -35,6 +35,12 @@ processors: detectors: [gcp] timeout: 10s + transform/metricprefix: + metric_statements: + - context: metric + statements: + - set(name, Concat(["otlp", name], ".")) + transform/collision: metric_statements: - context: datapoint