Merge "Update prometheus service discovery for openstack-exporter"
This commit is contained in:
commit
4004e0c0c5
@ -345,11 +345,63 @@ conf:
|
||||
# * `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: 'openstack-exporter'
|
||||
kubernetes_sd_configs:
|
||||
- role: endpoints
|
||||
scrape_interval: 60s
|
||||
relabel_configs:
|
||||
- source_labels:
|
||||
- __meta_kubernetes_service_name
|
||||
action: keep
|
||||
regex: "openstack-metrics"
|
||||
- source_labels:
|
||||
- __meta_kubernetes_service_annotation_prometheus_io_scrape
|
||||
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: kubernetes_namespace
|
||||
- source_labels:
|
||||
- __meta_kubernetes_service_name
|
||||
action: replace
|
||||
target_label: instance
|
||||
- source_labels:
|
||||
- __meta_kubernetes_service_name
|
||||
action: replace
|
||||
target_label: kubernetes_name
|
||||
- source_labels:
|
||||
- __meta_kubernetes_service_name
|
||||
target_label: job
|
||||
replacement: ${1}
|
||||
- job_name: 'kubernetes-service-endpoints'
|
||||
kubernetes_sd_configs:
|
||||
- role: endpoints
|
||||
scrape_interval: 60s
|
||||
relabel_configs:
|
||||
- source_labels:
|
||||
- __meta_kubernetes_service_name
|
||||
action: drop
|
||||
regex: "openstack-metrics"
|
||||
- source_labels:
|
||||
- __meta_kubernetes_service_annotation_prometheus_io_scrape
|
||||
action: keep
|
||||
|
Loading…
x
Reference in New Issue
Block a user