Skip to content

Instantly share code, notes, and snippets.

@buuhsmead
Last active August 26, 2020 11:06
Show Gist options
  • Save buuhsmead/430f0f16386a44501cfe81241f65e838 to your computer and use it in GitHub Desktop.
Save buuhsmead/430f0f16386a44501cfe81241f65e838 to your computer and use it in GitHub Desktop.
prometheus job with blackbox-exporter to scrape
- job_name: 'blackbox-scrape'
metrics_path: /probe # is the endpoint of blackbox-exporter itself
params:
module: ['tcp_connect'] # a module defined in blackbox-config.yaml inside blackbox image
kubernetes_sd_configs:
- role: endpoints
namespaces:
names:
- '${NAMESPACE}'
relabel_configs: # not correct at this moment WIP
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115 # Blackbox exporter service.
# Get specific info, like version info of blackbox exporter. Also if blackbox is up or down.
- job_name: blackbox-metrics
metrics_path: /metrics
static_configs:
- targets:
- localhost:9115
And get a blackbox-exporter image running and accessable at 'localhost:9115'.
@buuhsmead
Copy link
Author

module: refers to a defined config item inside the blackbox-config.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment