2020-06-18 08:04:41 -07:00
|
|
|
# A example scrape configuration for running Prometheus with
|
|
|
|
# DigitalOcean.
|
|
|
|
|
|
|
|
scrape_configs:
|
|
|
|
|
|
|
|
# Make Prometheus scrape itself for metrics.
|
|
|
|
- job_name: 'prometheus'
|
|
|
|
static_configs:
|
|
|
|
- targets: ['localhost:9090']
|
|
|
|
|
|
|
|
# Discover Node Exporter instances to scrape.
|
|
|
|
- job_name: 'node'
|
|
|
|
|
|
|
|
digitalocean_sd_configs:
|
2021-02-18 14:14:49 -08:00
|
|
|
- authorization:
|
|
|
|
credentials: "<replace with a Personal Access Token>"
|
2020-06-18 08:04:41 -07:00
|
|
|
relabel_configs:
|
|
|
|
# Only scrape targets that have a tag 'monitoring'.
|
|
|
|
- source_labels: [__meta_digitalocean_tags]
|
|
|
|
regex: '.*,monitoring,.*'
|
|
|
|
action: keep
|
|
|
|
|
|
|
|
# Use the public IPv6 address and port 9100 to scrape the target.
|
|
|
|
- source_labels: [__meta_digitalocean_public_ipv6]
|
|
|
|
target_label: __address__
|
|
|
|
replacement: '[$1]:9100'
|