File: prometheus-puppetdb.yml

package info (click to toggle)
prometheus 2.53.5%2Bds1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,456 kB
  • sloc: javascript: 2,423; yacc: 758; sh: 431; makefile: 231; lex: 189
file content (39 lines) | stat: -rw-r--r-- 1,538 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# 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:
    # 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.
      - 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