1
0
Fork 0

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.
etcd
Dustin 2024-02-20 20:05:25 -06:00
parent 815eefdcf9
commit 465f121e61
1 changed files with 26 additions and 0 deletions

View File

@ -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'