[stable/prometheus] added slow pod scrape config (#20443)

* added slow pod scrape config

Signed-off-by: André Bauer <andre.bauer@kiwigrid.com>

* removed whitespace

Signed-off-by: André Bauer <andre.bauer@kiwigrid.com>
This commit is contained in:
André Bauer
2020-01-30 04:20:13 -08:00
committed by GitHub
parent b0ca453f89
commit bd99f09e27
2 changed files with 40 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: prometheus
version: 10.3.1
version: 10.4.0
appVersion: 2.15.2
description: Prometheus is a monitoring system and time series database.
home: https://prometheus.io/
+39
View File
@@ -1496,6 +1496,45 @@ serverFiles:
action: replace
target_label: kubernetes_pod_name
# Example Scrape config for pods which should be scraped slower. An useful example
# would be stackriver-exporter which querys an API on every scrape of the pod
#
# The relabeling allows the actual pod scrape endpoint to be configured via the
# following annotations:
#
# * `prometheus.io/scrape-slow`: Only scrape pods that have a value of `true`
# * `prometheus.io/path`: If the metrics path is not `/metrics` override this.
# * `prometheus.io/port`: Scrape the pod on the indicated port instead of the default of `9102`.
- job_name: 'kubernetes-pods-slow'
scrape_interval: 5m
scrape_timeout: 30s
kubernetes_sd_configs:
- role: pod
relabel_configs:
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape_slow]
action: keep
regex: true
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
action: replace
target_label: __metrics_path__
regex: (.+)
- source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
target_label: __address__
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- source_labels: [__meta_kubernetes_namespace]
action: replace
target_label: kubernetes_namespace
- source_labels: [__meta_kubernetes_pod_name]
action: replace
target_label: kubernetes_pod_name
# adds additional scrape configs to prometheus.yml
# must be a string so you have to add a | after extraScrapeConfigs:
# example adds prometheus-blackbox-exporter scrape config