Skip to content
Snippets Groups Projects
Commit e9ce0825 authored by Hoai Viet Nguyen's avatar Hoai Viet Nguyen
Browse files

add prometheus and grafana for monitoring

parent 2cff2796
Branches main
No related tags found
No related merge requests found
{
servers {
metrics
}
}
:80 {
metrics /metrics
route / {
reverse_proxy todolist:8080
}
......
......@@ -4,3 +4,6 @@ include:
- caddy/caddy.docker-compose.yml
- todolist/todolist.docker-compose.yml
- postgres/postgres.docker-compose.yml
- prometheus/prometheus.docker-compose.yml
- grafana/grafana.docker-compose.yml
- postgres-exporter/postgres-exporter.docker-compose.yml
\ No newline at end of file
services:
grafana:
image: grafana/grafana-oss
ports:
- 3000:3000
\ No newline at end of file
services:
postgres-exporter:
image: quay.io/prometheuscommunity/postgres-exporter
environment:
- DATA_SOURCE_NAME=postgres://user:password@postgres:5432/todo?sslmode=disable
\ No newline at end of file
services:
prometheus:
image: prom/prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- 9090:9090
\ No newline at end of file
global:
scrape_interval: 15s
scrape_configs:
- job_name: caddy
static_configs:
- targets: ['caddy']
- job_name: postgres
static_configs:
- targets: ['postgres-exporter:9187']
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment