2024-02-26 09:33:04 +00:00
|
|
|
services:
|
|
|
|
# Grafana instance configured with VictoriaLogs as datasource
|
|
|
|
grafana:
|
|
|
|
container_name: grafana
|
2024-04-29 10:10:24 +00:00
|
|
|
image: grafana/grafana:10.4.2
|
2024-02-26 09:33:04 +00:00
|
|
|
depends_on:
|
|
|
|
- "victoriametrics"
|
|
|
|
- "victorialogs"
|
|
|
|
ports:
|
|
|
|
- 3000:3000
|
|
|
|
volumes:
|
|
|
|
- grafanadata:/var/lib/grafana
|
|
|
|
- ./provisioning/datasources/victorialogs-datasource:/etc/grafana/provisioning/datasources
|
|
|
|
- ./provisioning/dashboards:/etc/grafana/provisioning/dashboards
|
|
|
|
- ./provisioning/plugins/:/var/lib/grafana/plugins
|
|
|
|
- ./../../dashboards/victoriametrics.json:/var/lib/grafana/dashboards/vm.json
|
|
|
|
- ./../../dashboards/victorialogs.json:/var/lib/grafana/dashboards/vl.json
|
|
|
|
environment:
|
2024-11-20 15:38:20 +00:00
|
|
|
- "GF_INSTALL_PLUGINS=https://github.com/VictoriaMetrics/victorialogs-datasource/releases/download/v0.8.0/victorialogs-datasource-v0.8.0.zip;victorialogs-datasource"
|
2024-02-26 09:33:04 +00:00
|
|
|
- "GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=victorialogs-datasource"
|
|
|
|
networks:
|
|
|
|
- vm_net
|
|
|
|
restart: always
|
|
|
|
|
2024-11-28 12:25:25 +00:00
|
|
|
# vector is logs collector. It collects logs according to vector.yaml
|
2024-02-26 09:33:04 +00:00
|
|
|
# and forwards them to VictoriaLogs
|
2024-11-28 12:25:25 +00:00
|
|
|
vector:
|
|
|
|
image: docker.io/timberio/vector:0.42.X-distroless-libc
|
2024-02-26 09:33:04 +00:00
|
|
|
volumes:
|
2024-11-28 12:25:25 +00:00
|
|
|
- type: bind
|
|
|
|
source: /var/run/docker.sock
|
|
|
|
target: /var/run/docker.sock
|
|
|
|
- type: bind
|
|
|
|
source: /var/lib/docker
|
|
|
|
target: /var/lib/docker
|
|
|
|
- ./vector.yaml:/etc/vector/vector.yaml:ro
|
2024-02-26 09:33:04 +00:00
|
|
|
depends_on: [victorialogs]
|
|
|
|
ports:
|
2024-11-28 12:25:25 +00:00
|
|
|
- "8686:8686"
|
|
|
|
user: root
|
2024-02-26 09:33:04 +00:00
|
|
|
networks:
|
|
|
|
- vm_net
|
|
|
|
|
2024-10-21 21:42:30 +00:00
|
|
|
# VictoriaLogs instance, a single process responsible for
|
|
|
|
# storing logs and serving read queries.
|
2024-02-26 09:33:04 +00:00
|
|
|
victorialogs:
|
|
|
|
container_name: victorialogs
|
2024-11-12 18:15:55 +00:00
|
|
|
image: victoriametrics/victoria-logs:v1.0.0-victorialogs
|
2024-02-26 09:33:04 +00:00
|
|
|
command:
|
|
|
|
- "--storageDataPath=/vlogs"
|
|
|
|
- "--httpListenAddr=:9428"
|
|
|
|
volumes:
|
|
|
|
- vldata:/vlogs
|
|
|
|
ports:
|
|
|
|
- "9428:9428"
|
|
|
|
networks:
|
|
|
|
- vm_net
|
|
|
|
|
|
|
|
# VictoriaMetrics instance, a single process responsible for
|
|
|
|
# scraping, storing metrics and serve read requests.
|
|
|
|
victoriametrics:
|
|
|
|
container_name: victoriametrics
|
2024-11-18 13:56:32 +00:00
|
|
|
image: victoriametrics/victoria-metrics:v1.106.1
|
2024-02-26 09:33:04 +00:00
|
|
|
ports:
|
|
|
|
- 8428:8428
|
|
|
|
volumes:
|
|
|
|
- vmdata:/storage
|
|
|
|
- ./prometheus-victorialogs.yml:/etc/prometheus/prometheus.yml
|
|
|
|
command:
|
|
|
|
- "--storageDataPath=/storage"
|
|
|
|
- "--httpListenAddr=:8428"
|
|
|
|
- "--promscrape.config=/etc/prometheus/prometheus.yml"
|
|
|
|
networks:
|
|
|
|
- vm_net
|
|
|
|
restart: always
|
|
|
|
|
2024-10-29 15:30:39 +00:00
|
|
|
# vmauth is a router and balancer for HTTP requests.
|
|
|
|
# It proxies query requests from vmalert to either VictoriaMetrics or VictoriaLogs,
|
|
|
|
# depending on the requested path.
|
|
|
|
vmauth:
|
|
|
|
container_name: vmauth
|
2024-11-18 13:56:32 +00:00
|
|
|
image: victoriametrics/vmauth:v1.106.1
|
2024-10-29 15:30:39 +00:00
|
|
|
depends_on:
|
|
|
|
- "victoriametrics"
|
|
|
|
- "victorialogs"
|
|
|
|
volumes:
|
|
|
|
- ./auth-mixed-datasource.yml:/etc/auth.yml
|
|
|
|
command:
|
|
|
|
- "--auth.config=/etc/auth.yml"
|
|
|
|
ports:
|
|
|
|
- 8427:8427
|
|
|
|
networks:
|
|
|
|
- vm_net
|
|
|
|
restart: always
|
|
|
|
|
|
|
|
# vmalert executes alerting and recording rules according to given rule type.
|
2024-10-17 09:33:06 +00:00
|
|
|
vmalert:
|
|
|
|
container_name: vmalert
|
2024-11-18 13:56:32 +00:00
|
|
|
image: victoriametrics/vmalert:v1.106.1
|
2024-10-17 09:33:06 +00:00
|
|
|
depends_on:
|
2024-10-29 15:30:39 +00:00
|
|
|
- "vmauth"
|
2024-10-17 09:33:06 +00:00
|
|
|
- "alertmanager"
|
2024-10-29 15:30:39 +00:00
|
|
|
- "victoriametrics"
|
2024-10-17 09:33:06 +00:00
|
|
|
ports:
|
|
|
|
- 8880:8880
|
|
|
|
volumes:
|
2024-10-29 15:30:39 +00:00
|
|
|
- ./rules/alerts.yml:/etc/alerts/alerts.yml
|
2024-10-30 15:06:57 +00:00
|
|
|
- ./rules/alerts-vlogs.yml:/etc/alerts/vlogs.yml
|
2024-10-29 15:30:39 +00:00
|
|
|
- ./rules/alerts-health.yml:/etc/alerts/alerts-health.yml
|
|
|
|
- ./rules/alerts-vmagent.yml:/etc/alerts/alerts-vmagent.yml
|
|
|
|
- ./rules/alerts-vmalert.yml:/etc/alerts/alerts-vmalert.yml
|
2024-11-18 06:28:16 +00:00
|
|
|
# vlogs rule
|
|
|
|
- ./rules/vlogs-example-alerts.yml:/etc/alerts/vlogs-example-alerts.yml
|
2024-10-17 09:33:06 +00:00
|
|
|
command:
|
2024-10-29 15:30:39 +00:00
|
|
|
- "--datasource.url=http://vmauth:8427/"
|
2024-10-17 09:33:06 +00:00
|
|
|
- "--remoteRead.url=http://victoriametrics:8428/"
|
|
|
|
- "--remoteWrite.url=http://victoriametrics:8428/"
|
|
|
|
- "--notifier.url=http://alertmanager:9093/"
|
|
|
|
- "--rule=/etc/alerts/*.yml"
|
|
|
|
# display source of alerts in grafana
|
|
|
|
- "--external.url=http://127.0.0.1:3000" #grafana outside container
|
|
|
|
networks:
|
|
|
|
- vm_net
|
|
|
|
restart: always
|
|
|
|
|
|
|
|
# alertmanager receives alerting notifications from vmalert
|
|
|
|
# and distributes them according to --config.file.
|
|
|
|
alertmanager:
|
|
|
|
container_name: alertmanager
|
|
|
|
image: prom/alertmanager:v0.27.0
|
|
|
|
volumes:
|
|
|
|
- ./alertmanager.yml:/config/alertmanager.yml
|
|
|
|
command:
|
|
|
|
- "--config.file=/config/alertmanager.yml"
|
|
|
|
ports:
|
|
|
|
- 9093:9093
|
|
|
|
networks:
|
|
|
|
- vm_net
|
|
|
|
restart: always
|
|
|
|
|
2024-02-26 09:33:04 +00:00
|
|
|
volumes:
|
|
|
|
vmdata: {}
|
|
|
|
vldata: {}
|
|
|
|
grafanadata: {}
|
|
|
|
networks:
|
|
|
|
vm_net:
|