From c25494385550a35eb5a65b38800115eab28af60d Mon Sep 17 00:00:00 2001 From: vincent Date: Sat, 14 May 2022 09:33:04 +0200 Subject: [PATCH] improve nomad scrape --- promtail.nomad | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/promtail.nomad b/promtail.nomad index 1c085df..b92e0a2 100644 --- a/promtail.nomad +++ b/promtail.nomad @@ -59,6 +59,12 @@ scrape_configs: consul_sd_configs: - server: 'consul.service.consul:8500' relabel_configs: + - source_labels: [__meta_consul_service_metadata_external_source] + regex: nomad + action: keep + - source_labels: [__meta_consul_service] + regex: nomad|nomad-client + action: drop - source_labels: [__meta_consul_node] target_label: __host__ - source_labels: [__meta_consul_service_metadata_external_source] @@ -69,10 +75,6 @@ scrape_configs: regex: '_nomad-task-([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})-.*' target_label: 'task_id' replacement: '$1' - - source_labels: [__meta_consul_tags] - regex: ',(app|monitoring),' - target_label: 'group' - replacement: '$1' - source_labels: [__meta_consul_service] target_label: job - source_labels: ['__meta_consul_node']