update at 2024-04-23 16:58:12
parent
5a3451875a
commit
83b5aff336
|
@ -4,14 +4,14 @@
|
||||||
- role: pod
|
- role: pod
|
||||||
|
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
# Example relabel to scrape only pods that have
|
# prometheus relabel to scrape only pods that have
|
||||||
# `prometheus.io/scrape: "true"` annotation.
|
# `prometheus.io/scrape: "true"` annotation.
|
||||||
- source_labels:
|
- source_labels:
|
||||||
- __meta_kubernetes_pod_annotation_prometheus_io_scrape
|
- __meta_kubernetes_pod_annotation_prometheus_io_scrape
|
||||||
action: keep
|
action: keep
|
||||||
regex: true
|
regex: true
|
||||||
|
|
||||||
# Example relabel to customize metric path based on pod
|
# prometheus relabel to customize metric path based on pod
|
||||||
# `prometheus.io/path: <metric path>` annotation.
|
# `prometheus.io/path: <metric path>` annotation.
|
||||||
- source_labels:
|
- source_labels:
|
||||||
- __meta_kubernetes_pod_annotation_prometheus_io_path
|
- __meta_kubernetes_pod_annotation_prometheus_io_path
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
target_label: __metrics_path__
|
target_label: __metrics_path__
|
||||||
regex: (.+)
|
regex: (.+)
|
||||||
|
|
||||||
# Example relabel to scrape only single, desired port for the pod
|
# prometheus relabel to scrape only single, desired port for the pod
|
||||||
# based on pod `prometheus.io/port: <port>` annotation.
|
# based on pod `prometheus.io/port: <port>` annotation.
|
||||||
- source_labels:
|
- source_labels:
|
||||||
- __address__
|
- __address__
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
- __meta_kubernetes_service_annotation_prometheus_io_scrape
|
- __meta_kubernetes_service_annotation_prometheus_io_scrape
|
||||||
action: keep
|
action: keep
|
||||||
regex: true
|
regex: true
|
||||||
#
|
|
||||||
# prometheus relabel to customize metric path based on endpoints
|
# prometheus relabel to customize metric path based on endpoints
|
||||||
# `prometheus.io/path: <metric path>` annotation.
|
# `prometheus.io/path: <metric path>` annotation.
|
||||||
- source_labels:
|
- source_labels:
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
action: replace
|
action: replace
|
||||||
target_label: __metrics_path__
|
target_label: __metrics_path__
|
||||||
regex: (.+)
|
regex: (.+)
|
||||||
#
|
|
||||||
# prometheus relabel to scrape only single, desired port for the service based
|
# prometheus relabel to scrape only single, desired port for the service based
|
||||||
# on endpoints `prometheus.io/port: <port>` annotation.
|
# on endpoints `prometheus.io/port: <port>` annotation.
|
||||||
- source_labels:
|
- source_labels:
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
regex: ([^:]+)(?::\d+)?;(\d+)
|
regex: ([^:]+)(?::\d+)?;(\d+)
|
||||||
replacement: $1:$2
|
replacement: $1:$2
|
||||||
target_label: __address__
|
target_label: __address__
|
||||||
#
|
|
||||||
# prometheus relabel to configure scrape scheme for all service scrape targets
|
# prometheus relabel to configure scrape scheme for all service scrape targets
|
||||||
# based on endpoints `prometheus.io/scheme: <scheme>` annotation.
|
# based on endpoints `prometheus.io/scheme: <scheme>` annotation.
|
||||||
- source_labels:
|
- source_labels:
|
||||||
|
|
Loading…
Reference in New Issue