Fix the prometheus default configuration template. Fix the systemd unit file.

This commit is contained in:
Andrea Dell'Amico 2018-04-20 12:09:56 +02:00
parent f5b5e06629
commit 725964d36a
4 changed files with 4 additions and 14 deletions

View File

@ -37,7 +37,7 @@
when: ansible_service_mgr != 'systemd'
- name: Install the prometheus server systemd unit
copy: src=prometheus.systemd dest=/etc/systemd/system/prometheus.service mode=0644 owner=root group=root
template: src=prometheus.systemd dest=/etc/systemd/system/prometheus.service mode=0644 owner=root group=root
when: ansible_service_mgr == 'systemd'
notify: systemd reload

View File

@ -5,5 +5,5 @@ PROMETHEUS_DATADIR={{ prometheus_home }}/data
PROMETHEUS_LOGLEVEL={{ prometheus_loglevel }}
PROMETHEUS_CONF={{ prometheus_confdir }}/prometheus.yml
PROMETHEUS_OPTS="{{ prometheus_opts }}"
PROMETHEUS_STARTUP_OPTS="--config.file={{ prometheus_confdir }}/prometheus.yml --storage.tsdb.path={{ prometheus_home }}/data {{ prometheus_opts }} --log.level={{ prometheus_loglevel }}"

View File

@ -8,7 +8,7 @@ Type=simple
User={{ prometheus_user }}
Group={{ prometheus_user }}
EnvironmentFile=/etc/default/prometheus
ExecStart=${PROMETHEUS_CMD} --config.file=${PROMETHEUS_CONF} --storage.tsdb.path=${PROMETHEUS_DATADIR} --log.level=${PROMETHEUS_LOGLEVEL} ${PROMETHEUS_OPTS}
ExecStart={{ prometheus_cmd }} $PROMETHEUS_STARTUP_OPTS
Restart=on-failure
[Install]

View File

@ -1,4 +1,3 @@
# 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.
@ -26,13 +25,4 @@ scrape_configs:
# scheme defaults to 'http'.
static_configs:
- targets: ['localhost:9090'], 'localhost:9100']
labels:
group: 'Prometheus Server'
- job_name: 'node'
static_configs:
- targets: [ 'localhost:9100']
labels:
group: 'node'
- targets: ['localhost:9090']