add prometheus
don't publish traefik api
This commit is contained in:
parent
68981f3f66
commit
9cc5fba042
12 changed files with 68 additions and 11 deletions
roles/prometheus/templates
13
roles/prometheus/templates/docker-compose.yml.j2
Normal file
13
roles/prometheus/templates/docker-compose.yml.j2
Normal file
|
@ -0,0 +1,13 @@
|
|||
version: "3.8"
|
||||
|
||||
services:
|
||||
prometheus:
|
||||
image: prom/prometheus
|
||||
container_name: prometheus
|
||||
restart: always
|
||||
volumes:
|
||||
- "{{ service_dir }}/prometheus.yml:/etc/prometheus/prometheus.yml"
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
ports:
|
||||
- "{{ prometheus_port }}:9090"
|
14
roles/prometheus/templates/prometheus.yml.j2
Normal file
14
roles/prometheus/templates/prometheus.yml.j2
Normal file
|
@ -0,0 +1,14 @@
|
|||
global:
|
||||
scrape_interval: 15s
|
||||
|
||||
scrape_configs:
|
||||
|
||||
- job_name: 'prometheus'
|
||||
scrape_interval: 5s
|
||||
static_configs:
|
||||
- targets: ['localhost:9090']
|
||||
|
||||
- job_name: 'traefik'
|
||||
scrape_interval: 5s
|
||||
static_configs:
|
||||
- targets: ['host.docker.internal:{{ traefik_api_port }}']
|
Reference in a new issue