-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkubernetes-service-endpoints-slow.yaml
57 lines (57 loc) · 2.13 KB
/
kubernetes-service-endpoints-slow.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# -- Scrape config for slow service endpoints; same as above, but with a larger
# timeout and a larger interval
#
# The relabeling allows the actual service scrape endpoint to be configured
# via the following annotations:
#
# * `prometheus.io/scrape-slow`: Only scrape services that have a value of `true`
# * `prometheus.io/scheme`: If the metrics endpoint is secured then you will need
# to set this to `https` & most likely set the `tls_config` of the scrape config.
# * `prometheus.io/path`: If the metrics path is not `/metrics` override this.
# * `prometheus.io/port`: If the metrics are exposed on a different port to the
# service then set this appropriately.
- job_name: "kubernetes-service-endpoints-slow"
scrape_interval: 5m
scrape_timeout: 30s
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- action: drop
source_labels: [ __meta_kubernetes_pod_container_init ]
regex: true
- action: keep_if_equal
source_labels: [ __meta_kubernetes_service_annotation_prometheus_io_port, __meta_kubernetes_pod_container_port_number ]
- source_labels:
[ __meta_kubernetes_service_annotation_prometheus_io_scrape_slow ]
action: keep
regex: true
- source_labels:
[ __meta_kubernetes_service_annotation_prometheus_io_scheme ]
action: replace
target_label: __scheme__
regex: (https?)
- source_labels:
[ __meta_kubernetes_service_annotation_prometheus_io_path ]
action: replace
target_label: __metrics_path__
regex: (.+)
- source_labels:
[
__address__,
__meta_kubernetes_service_annotation_prometheus_io_port,
]
action: replace
target_label: __address__
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
- action: labelmap
regex: __meta_kubernetes_service_label_(.+)
- source_labels: [ __meta_kubernetes_namespace ]
action: replace
target_label: namespace
- source_labels: [ __meta_kubernetes_service_name ]
action: replace
target_label: service_name
- source_labels: [ __meta_kubernetes_pod_node_name ]
action: replace
target_label: node