From 27c1c75d3b37061b2d087da9675d5b0fc8fc2696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz?= Date: Fri, 7 Mar 2025 10:40:56 +0100 Subject: [PATCH] Refactor filters section --- ansible/roles/prometheus/templates/prometheus.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ansible/roles/prometheus/templates/prometheus.yml b/ansible/roles/prometheus/templates/prometheus.yml index 2c89f9b..762d3a8 100755 --- a/ansible/roles/prometheus/templates/prometheus.yml +++ b/ansible/roles/prometheus/templates/prometheus.yml @@ -225,7 +225,7 @@ scrape_configs: secret_key: "{{prometheus_aws_secret_key_dev}}" region: "eu-central-1" port: 9100 - filters: + filters: &instance_filters - name: instance-state-name values: ['running'] relabel_configs: &ec2_relabeling # Change the host to the proxy host with relabeling @@ -273,9 +273,8 @@ scrape_configs: secret_key: "{{prometheus_aws_secret_key_prod}}" region: "eu-central-1" port: 9100 - filters: - - name: instance-state-name - values: ['running'] + filters: + *instance_filters relabel_configs: # Change the host to the proxy host with relabeling *ec2_relabeling