From 0b5e662abc9b269e8e7e4c9a018ed1c020734288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Sch=C3=A4fer?= Date: Tue, 7 Oct 2025 12:37:44 +0200 Subject: [PATCH] fix: Update otel-collector.yaml to correct resource attribute checks and streamline processor/exporter configuration --- examples/otel-collector.yaml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/examples/otel-collector.yaml b/examples/otel-collector.yaml index c2b6854..6000013 100644 --- a/examples/otel-collector.yaml +++ b/examples/otel-collector.yaml @@ -9,33 +9,36 @@ processors: check_interval: 5s limit_percentage: 80 spike_limit_percentage: 25 - batch: {} - transform/promote: - metric_statements: - - context: datapoint - statements: - - set(attributes["service_instance_id"], resource.attributes["service.instance.id"]) where IsMapKey(resource.attributes, "service.instance.id") - - set(attributes["site_id"], resource.attributes["site_id"]) where IsMapKey(resource.attributes, "site_id") resourcedetection: detectors: [env, host] timeout: 5s + batch: {} + transform/promote: + # optional, damit fehlende Keys nicht die Pipeline abbrechen: + error_mode: ignore + metric_statements: + - context: datapoint + statements: + - set(attributes["service_instance_id"], resource.attributes["service.instance.id"]) where IsSet(resource.attributes["service.instance.id"]) + - set(attributes["site_id"], resource.attributes["site_id"]) where IsSet(resource.attributes["site_id"]) exporters: prometheus: endpoint: 0.0.0.0:8889 send_timestamps: true - prometheusremotewrite: - # Replace with your remote_write endpoint (Mimir/Cortex/VictoriaMetrics/Thanos Receive) - endpoint: http://mimir:9009/api/v1/push + # Falls du kein Remote-Write-Ziel hast, kommentiere es aus: + # prometheusremotewrite: + # endpoint: http://mimir:9009/api/v1/push + debug: + verbosity: basic service: pipelines: metrics: receivers: [otlp] - processors: [memory_limiter, resourcedetection, batch, transform/promote] - exporters: [prometheus, prometheusremotewrite] + processors: [memory_limiter, resourcedetection, transform/promote, batch] + exporters: [prometheus] # , prometheusremotewrite traces: receivers: [otlp] processors: [memory_limiter, resourcedetection, batch] - exporters: [] - + exporters: [debug]