Getting started Prometheus tutorial
This commit is contained in:
parent
b2c6a71519
commit
94749f1b06
10
roles/prometheus/prometheus-config.yml
Normal file
10
roles/prometheus/prometheus-config.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
global:
|
||||||
|
scrape_interval: 15s
|
||||||
|
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: 'prometheus'
|
||||||
|
|
||||||
|
scrape_interval: 5s
|
||||||
|
|
||||||
|
static_configs:
|
||||||
|
- targets: ['localhost:9090']
|
@ -1,8 +1,15 @@
|
|||||||
|
- name: Install Prometheus configuration
|
||||||
|
template:
|
||||||
|
src: prometheus-config.yml
|
||||||
|
dest: /home/{{ docker_user }}/prometheus.yml
|
||||||
|
|
||||||
- name: Start Prometheus container
|
- name: Start Prometheus container
|
||||||
docker_container:
|
docker_container:
|
||||||
name: "{{ prom_name }}"
|
name: "{{ prom_name }}"
|
||||||
image: prom/prometheus:{{ prom_version }}
|
image: prom/prometheus:{{ prom_version }}
|
||||||
state: started
|
state: started
|
||||||
restart_policy: always
|
restart_policy: always
|
||||||
|
volumes:
|
||||||
|
- /home/{{ docker_user }}/prometheus.yml:/etc/prometheus/prometheus.yml
|
||||||
ports:
|
ports:
|
||||||
- "80:9090"
|
- "80:9090"
|
||||||
|
Loading…
Reference in New Issue
Block a user