From 465f121e615968ecf47d42c87df7f73fa4c263df Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Tue, 20 Feb 2024 20:05:25 -0600 Subject: [PATCH] v-m: Scrape Promtail The *promtail* job scrapes metrics from all the hosts running Promtail. The static targets are Fedora CoreOS nodes that are not part of the Kubernetes cluster. The relabeling rules ensure that both the static targets and the targets discovered via the Kubernetes Node API use the FQDN of the host as the value of the *instance* label. --- victoria-metrics/scrape.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/victoria-metrics/scrape.yml b/victoria-metrics/scrape.yml index 213c339..2fed0fd 100644 --- a/victoria-metrics/scrape.yml +++ b/victoria-metrics/scrape.yml @@ -307,3 +307,29 @@ scrape_configs: static_configs: - targets: - loki.pyrocufflink.blue + +- job_name: promtail + static_configs: + - targets: + - loki0.pyrocufflink.blue + - nut0.pyrocufflink.blue + - nvr1.pyrocufflink.blue + - serial1.pyrocufflink.blue + kubernetes_sd_configs: + - role: pod + namespaces: + names: + - promtail + selectors: + - role: pod + label: app.kubernetes.io/name=promtail + relabel_configs: + - source_labels: [__address__] + target_label: instance + - source_labels: [__meta_kubernetes_pod_node_name] + regex: '(.+)' + target_label: instance + - source_labels: [__address__] + target_label: __address__ + regex: '([^:]+)' + replacement: '$1:9080'