diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2019-03-05 22:33:19 -0500 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2019-03-05 22:33:19 -0500 |
| commit | a436d3d340a96d473c2b7c7a29cebd54367a60b4 (patch) | |
| tree | 13059eb336ce2bd4ec25ec97c47d27e45006ee09 /templates | |
| download | prometheus-a436d3d340a96d473c2b7c7a29cebd54367a60b4.tar.gz prometheus-a436d3d340a96d473c2b7c7a29cebd54367a60b4.tar.xz | |
Initial
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/prometheus/prometheus.yml | 53 | ||||
| -rw-r--r-- | templates/prometheus/runit/run | 5 | ||||
| -rw-r--r-- | templates/prometheus/systemd.unit | 15 |
3 files changed, 73 insertions, 0 deletions
diff --git a/templates/prometheus/prometheus.yml b/templates/prometheus/prometheus.yml new file mode 100644 index 0000000..2099b8b --- /dev/null +++ b/templates/prometheus/prometheus.yml @@ -0,0 +1,53 @@ +# my global config +global: + scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. + evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. + # scrape_timeout is set to the global default (10s). + +# Alertmanager configuration +alerting: + alertmanagers: + - static_configs: + - targets: + # - alertmanager:9093 + +# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. +rule_files: + # - "first_rules.yml" + # - "second_rules.yml" + +# A scrape configuration containing exactly one endpoint to scrape: +# Here it's Prometheus itself. +scrape_configs: + # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. + - job_name: 'prometheus' + + # metrics_path defaults to '/metrics' + # scheme defaults to 'http'. + + static_configs: + - targets: ['localhost:9090'] + + - job_name: 'netdata' + + metrics_path: /api/v1/allmetrics + params: + format: [ prometheus ] + + static_configs: +{% for h in prometheus_netdata_hosts %} - targets: ['{{h}}'] +{%endfor%} + +{% if prometheus_netdata_tls_hosts is defined %} + - job_name: 'netdata_tls' + + scheme: https + + metrics_path: /api/v1/allmetrics + params: + format: [ prometheus ] + + static_configs: +{% for h in prometheus_netdata_tls_hosts %} - targets: ['{{h}}'] +{%endfor%} +{% endif %} diff --git a/templates/prometheus/runit/run b/templates/prometheus/runit/run new file mode 100644 index 0000000..f70f1ae --- /dev/null +++ b/templates/prometheus/runit/run @@ -0,0 +1,5 @@ +#!/bin/sh +exec {{prometheus_home_dir}}/prometheus/prometheus \ + --config.file "{{prometheus_home_dir}}/conf/prometheus.yml" \ + --storage.tsdb.path "{{prometheus_data_dir}}" \ + --web.listen-address "{{prometheus_ui_listen}}" diff --git a/templates/prometheus/systemd.unit b/templates/prometheus/systemd.unit new file mode 100644 index 0000000..856f299 --- /dev/null +++ b/templates/prometheus/systemd.unit @@ -0,0 +1,15 @@ +# /etc/systemd/system/prometheus.service +[Unit] +Description=Prometheus Server +Documentation=https://prometheus.io/docs/introduction/overview/ +After=network-online.target + +[Service] +User=prometheus +Restart=on-failure +ExecStart={{prometheus_home_dir}}/prometheus/prometheus \ + --config.file "{{prometheus_home_dir}}/conf/prometheus.yml" \ + --storage.tsdb.path "{{prometheus_data_dir}}" \ + --web.listen-address "{{prometheus_ui_listen}}" +[Install] +WantedBy=multi-user.target |
