Skip to content

Instantly share code, notes, and snippets.

@mlushpenko
Created June 18, 2020 15:22
Show Gist options
  • Save mlushpenko/6b56d6bfe178d6fb513c9724296d06f1 to your computer and use it in GitHub Desktop.
Save mlushpenko/6b56d6bfe178d6fb513c9724296d06f1 to your computer and use it in GitHub Desktop.
blackbox-ingress
## Monitor Kubernetes ingress endpoints
- job_name: blackbox
metrics_path: /probe
params:
module: [http_2xx]
kubernetes_sd_configs:
- role: ingress
relabel_configs:
# 1. Set ingress address protocol to https, so we can make sure certificates are valid while probing endpoints
- source_labels: [__address__]
regex: (.*)
action: replace
replacement: https://$1
target_label: __param_target
# 2. Save address in an instance label since __param_target is going to be dropped
- source_labels: [__param_target]
target_label: instance
# 3. Replace address with an internal blackbox service so scraper is always pointed at blackbox-exporter
- target_label: __address__
replacement: blackbox-exporter:9115
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment