From 80175d609c8cfcc8572f38c6d502ba7aedb5ff1f Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Mon, 12 Oct 2020 23:20:49 +0900 Subject: [PATCH] Change `Loki` endpoint to `loki.service.consul:3100`. --- .../prometheus/templates/etc/promtail/prometheus.yaml | 8 ++++---- cookbooks/promtail/attributes.rb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cookbooks/prometheus/templates/etc/promtail/prometheus.yaml b/cookbooks/prometheus/templates/etc/promtail/prometheus.yaml index 8b091c8..e48839b 100644 --- a/cookbooks/prometheus/templates/etc/promtail/prometheus.yaml +++ b/cookbooks/prometheus/templates/etc/promtail/prometheus.yaml @@ -5,7 +5,7 @@ positions: filename: /var/opt/promtail/promtail_prometheus_position.yaml clients: - - url: http://192.168.10.118:3100/loki/api/v1/push + - url: http://<%= @LOKIENDPOINT %>/loki/api/v1/push scrape_configs: - job_name: prometheus @@ -33,7 +33,7 @@ scrape_configs: location: Etc/UTC - labels: - level: + level: - output: source: message @@ -63,7 +63,7 @@ scrape_configs: location: Etc/UTC - labels: - level: + level: - output: source: message @@ -104,7 +104,7 @@ scrape_configs: template: '{{ regexReplaceAllLiteral "resolved" .Value "notice" }}' - labels: - level: + level: - output: source: message diff --git a/cookbooks/promtail/attributes.rb b/cookbooks/promtail/attributes.rb index 473421a..71adf26 100644 --- a/cookbooks/promtail/attributes.rb +++ b/cookbooks/promtail/attributes.rb @@ -8,7 +8,7 @@ node.reverse_merge!({ 'storage' => '/opt/promtail/bin/', 'location' => '/usr/local/bin/', 'data' => '/var/opt/promtail/', - 'lokiendpoint' => '192.168.10.118:3100' + 'lokiendpoint' => 'loki.service.consul:3100' }, })