monitoring: add initial implementation of prometheus
This commit is contained in:
parent
bd8e1b8e38
commit
9844a1ab5c
@ -53,3 +53,13 @@ services:
|
||||
- /var/log:/var/log:ro
|
||||
tmpfs:
|
||||
- /tmp
|
||||
|
||||
prometheus:
|
||||
image: prom/prometheus:latest
|
||||
container_name: prometheus
|
||||
restart: unless-stopped
|
||||
user: "{{ remote_uid }}"
|
||||
volumes:
|
||||
- ./prometheus_config:/etc/prometheus:ro
|
||||
- {{ base_volume_path }}/monitoring/prometheus_configs:/etc/prometheus/extra:ro
|
||||
- {{ base_volume_path }}/monitoring/prometheus:/prometheus
|
||||
|
@ -8,3 +8,11 @@ datasources:
|
||||
uid: loki
|
||||
url: http://loki:3100
|
||||
editable: false
|
||||
|
||||
- name: Prometheus
|
||||
type: prometheus
|
||||
version: 1
|
||||
access: proxy
|
||||
uid: prometheus
|
||||
url: http://prometheus:9090
|
||||
editable: false
|
||||
|
@ -0,0 +1,31 @@
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
|
||||
external_labels:
|
||||
monitor: "{{ ansible_host }}"
|
||||
|
||||
scrape_configs:
|
||||
- job_name: "prometheus"
|
||||
static_configs:
|
||||
- targets: ["localhost:9090"]
|
||||
|
||||
- job_name: "node"
|
||||
static_configs:
|
||||
- targets: ["{{ ansible_host }}:9100"]
|
||||
|
||||
- job_name: "loki"
|
||||
static_configs:
|
||||
- targets: ["loki:3100"]
|
||||
|
||||
- job_name: "promtail"
|
||||
static_configs:
|
||||
- targets: ["promtail:9080"]
|
||||
|
||||
rule_files:
|
||||
- "/etc/prometheus/extra/rules/*.yml"
|
||||
- "/etc/prometheus/extra/rules/*.json"
|
||||
|
||||
scrape_config_files:
|
||||
- "/etc/prometheus/extra/scrape_configs/*.yml"
|
||||
- "/etc/prometheus/extra/scrape_configs/*.json"
|
@ -5,6 +5,7 @@
|
||||
- docker-ce
|
||||
- docker-compose-plugin
|
||||
- firewalld
|
||||
- prometheus-node-exporter
|
||||
state: latest
|
||||
|
||||
- name: Upgrade Debian packages
|
||||
|
Loading…
x
Reference in New Issue
Block a user