feat: add prometheus
This commit is contained in:
parent
8c043a8adb
commit
4e78d3958d
53
compose.yml
53
compose.yml
@ -41,6 +41,59 @@ services:
|
||||
networks:
|
||||
- teacinema
|
||||
|
||||
postgres-exporter:
|
||||
container_name: postgres-exporter
|
||||
image: 'prometheuscommunity/postgres-exporter'
|
||||
environment:
|
||||
DATA_SOURCE_NAME: 'postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/postgres?sslmode=disable'
|
||||
ports:
|
||||
- "9187:9187"
|
||||
networks:
|
||||
- teacinema
|
||||
depends_on:
|
||||
- postgres
|
||||
|
||||
redis-exporter:
|
||||
container_name: redis-exporter
|
||||
image: 'oliver006/redis_exporter'
|
||||
command: -redis.addr=redis//:${REDIS_PASSWORD}@redis:6379
|
||||
ports:
|
||||
- "9121:9121"
|
||||
networks:
|
||||
- teacinema
|
||||
depends_on:
|
||||
- redis
|
||||
|
||||
rabbitmq-exporter:
|
||||
container_name: rabbitmq-exporter
|
||||
image: 'kbudde/rabbitmq-exporter'
|
||||
environment:
|
||||
RABBIT_URL: 'http://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@rabbitmq:15672'
|
||||
ports:
|
||||
- "9419:9419"
|
||||
networks:
|
||||
- teacinema
|
||||
depends_on:
|
||||
- rabbitmq
|
||||
|
||||
node-exporter:
|
||||
container_name: node-exporter
|
||||
image: 'prom/node-exporter'
|
||||
ports:
|
||||
- "9100:9100"
|
||||
networks:
|
||||
- teacinema
|
||||
|
||||
prometheus:
|
||||
container_name: prometheus
|
||||
image: 'prom/prometheus:latest'
|
||||
volumes:
|
||||
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
||||
ports:
|
||||
- "9090:9090"
|
||||
networks:
|
||||
- teacinema
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
redis_data:
|
||||
|
||||
35
prometheus.yml
Normal file
35
prometheus.yml
Normal file
@ -0,0 +1,35 @@
|
||||
global:
|
||||
scrape_interval: 5s
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'gateway'
|
||||
metrics_path: '/metrics'
|
||||
static_configs:
|
||||
- targets:
|
||||
- 'gateway-service:4000'
|
||||
|
||||
- job_name: 'postgres'
|
||||
static_configs:
|
||||
- targets:
|
||||
- 'postgres-exporter:9187'
|
||||
|
||||
- job_name: 'redis'
|
||||
static_configs:
|
||||
- targets:
|
||||
- 'redis-exporter:9121'
|
||||
|
||||
- job_name: 'rabbitmq'
|
||||
static_configs:
|
||||
- targets:
|
||||
- 'rabbitmq-exporter:9419'
|
||||
|
||||
- job_name: 'node'
|
||||
static_configs:
|
||||
- targets:
|
||||
- 'node-exporter:9100'
|
||||
|
||||
- job_name: 'prometheus'
|
||||
static_configs:
|
||||
- targets:
|
||||
- 'prometheus:9090'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user