2021-06-01 05:04:58 -07:00
|
|
|
# Prometheus example configuration to be used with PuppetDB.
|
|
|
|
|
|
|
|
scrape_configs:
|
|
|
|
- job_name: 'puppetdb-node-exporter'
|
|
|
|
puppetdb_sd_configs:
|
|
|
|
# This example discovers the nodes which have the class Prometheus::Node_exporter.
|
|
|
|
- url: https://puppetdb.example.com
|
|
|
|
query: 'resources { type = "Class" and title = "Prometheus::Node_exporter" }'
|
|
|
|
port: 9100
|
|
|
|
tls_config:
|
|
|
|
cert_file: prometheus-public.pem
|
|
|
|
key_file: prometheus-private.pem
|
|
|
|
ca_file: ca.pem
|
|
|
|
|
|
|
|
- job_name: 'puppetdb-scrape-jobs'
|
|
|
|
puppetdb_sd_configs:
|
2021-10-20 12:03:17 -07:00
|
|
|
# This example uses Prometheus::Scrape_job exported resources.
|
|
|
|
# It is compatible with the prometheus-puppetdb-sd
|
|
|
|
# (https://github.com/camptocamp/prometheus-puppetdb-sd) if the
|
|
|
|
# exported resources have exactly one target.
|
2021-06-01 05:04:58 -07:00
|
|
|
- url: https://puppetdb.example.com
|
|
|
|
query: 'resources { type = "Prometheus::Scrape_job" and exported = true }'
|
|
|
|
include_parameters: true
|
|
|
|
tls_config:
|
|
|
|
cert_file: prometheus-public.pem
|
|
|
|
key_file: prometheus-private.pem
|
|
|
|
ca_file: ca.pem
|
|
|
|
relabel_configs:
|
|
|
|
- source_labels: [__meta_puppetdb_certname]
|
|
|
|
target_label: certname
|
|
|
|
- source_labels: [__meta_puppetdb_parameter_targets]
|
|
|
|
regex: '(.+),?.*'
|
|
|
|
replacement: $1
|
|
|
|
target_label: __address__
|
|
|
|
- source_labels: [__meta_puppetdb_parameter_job_name]
|
|
|
|
target_label: job
|
|
|
|
- regex: '__meta_puppetdb_parameter_labels_(.+)'
|
|
|
|
replacement: '$1'
|
|
|
|
action: labelmap
|