prometheus/documentation/examples/prometheus-nomad.yml
Bram Vogelaar 4456dcc26e feat(nomad): add nomad service discovery
Signed-off-by: Bram Vogelaar <bram@attachmentgenie.com>
2022-06-30 14:17:08 +02:00

24 lines
743 B
YAML

# An example scrape configuration for running Prometheus with
# Nomad build in service discovery.
#
# The following config can be used to monitor services running on
# a nomad that is started using the getting started tutorial [1]
#
# sudo nomad agent -dev -bind 0.0.0.0 -log-level INFO
#
# [1] https://learn.hashicorp.com/tutorials/nomad/get-started-run?in=nomad/get-started
scrape_configs:
# Make Prometheus scrape itself for metrics.
- job_name: "prometheus"
static_configs:
- targets: ["localhost:9090"]
# Discover Nomad services to scrape.
- job_name: 'nomad_sd'
nomad_sd_configs:
- server: 'http://localhost:4646'
relabel_configs:
- source_labels: [__meta_nomad_service]
target_label: job