2020-08-21 06:49:19 -07:00
|
|
|
# A example scrape configuration for running Prometheus with
|
|
|
|
# Hetzner.
|
|
|
|
|
|
|
|
scrape_configs:
|
|
|
|
# Make Prometheus scrape itself for metrics.
|
2021-06-12 03:47:47 -07:00
|
|
|
- job_name: "prometheus"
|
2020-08-21 06:49:19 -07:00
|
|
|
static_configs:
|
2021-06-12 03:47:47 -07:00
|
|
|
- targets: ["localhost:9090"]
|
2020-08-21 06:49:19 -07:00
|
|
|
|
|
|
|
# Discover Node Exporter instances to scrape.
|
2021-06-12 03:47:47 -07:00
|
|
|
- job_name: "node"
|
2020-08-21 06:49:19 -07:00
|
|
|
|
|
|
|
hetzner_sd_configs:
|
2021-02-18 14:14:49 -08:00
|
|
|
- authorization:
|
|
|
|
credentials: "<replace with a Hetzner Cloud API Token>"
|
2022-05-26 01:17:21 -07:00
|
|
|
role: "hcloud"
|
2020-08-21 06:49:19 -07:00
|
|
|
relabel_configs:
|
|
|
|
# Use the public IPv4 and port 9100 to scrape the target.
|
|
|
|
- source_labels: [__meta_hetzner_public_ipv4]
|
|
|
|
target_label: __address__
|
2021-06-12 03:47:47 -07:00
|
|
|
replacement: "$1:9100"
|
2020-08-21 06:49:19 -07:00
|
|
|
|
|
|
|
# Discover Node Exporter instances to scrape using a Hetzner Cloud Network called mynet.
|
2021-06-12 03:47:47 -07:00
|
|
|
- job_name: "node_private"
|
2020-08-21 06:49:19 -07:00
|
|
|
|
|
|
|
hetzner_sd_configs:
|
2021-02-18 14:14:49 -08:00
|
|
|
- authorization:
|
|
|
|
credentials: "<replace with a Hetzner Cloud API Token>"
|
2022-05-26 01:17:21 -07:00
|
|
|
role: "hcloud"
|
2020-08-21 06:49:19 -07:00
|
|
|
relabel_configs:
|
|
|
|
# Use the private IPv4 within the Hetzner Cloud Network and port 9100 to scrape the target.
|
|
|
|
- source_labels: [__meta_hetzner_hcloud_private_ipv4_mynet]
|
|
|
|
target_label: __address__
|
2021-06-12 03:47:47 -07:00
|
|
|
replacement: "$1:9100"
|
2020-08-21 06:49:19 -07:00
|
|
|
|
|
|
|
# Discover Node Exporter instances to scrape.
|
2021-06-12 03:47:47 -07:00
|
|
|
- job_name: "node_robot"
|
2020-08-21 06:49:19 -07:00
|
|
|
|
|
|
|
hetzner_sd_configs:
|
|
|
|
- basic_auth:
|
|
|
|
username: "<replace with a Hetzner Robot API username>"
|
|
|
|
password: "<replace with a Hetzner Robot API password>"
|
2022-05-26 01:17:21 -07:00
|
|
|
role: "robot"
|
2020-08-21 06:49:19 -07:00
|
|
|
relabel_configs:
|
|
|
|
# Use the public IPv4 and port 9100 to scrape the target.
|
|
|
|
- source_labels: [__meta_hetzner_public_ipv4]
|
|
|
|
target_label: __address__
|
2021-06-12 03:47:47 -07:00
|
|
|
replacement: "$1:9100"
|