84 lines
2.0 KiB
YAML
84 lines
2.0 KiB
YAML
# Prometheus configuration for my-uploader-bot monitoring
|
|
|
|
global:
|
|
scrape_interval: 15s
|
|
evaluation_interval: 15s
|
|
external_labels:
|
|
cluster: 'my-uploader-bot'
|
|
environment: 'production'
|
|
|
|
# Rules for alerting
|
|
rule_files:
|
|
- "alert_rules.yml"
|
|
|
|
# Alertmanager configuration
|
|
alerting:
|
|
alertmanagers:
|
|
- static_configs:
|
|
- targets:
|
|
- alertmanager:9093
|
|
|
|
# Scrape configurations
|
|
scrape_configs:
|
|
# Prometheus itself
|
|
- job_name: 'prometheus'
|
|
static_configs:
|
|
- targets: ['localhost:9090']
|
|
scrape_interval: 30s
|
|
metrics_path: '/metrics'
|
|
|
|
# Main application
|
|
- job_name: 'my-uploader-bot'
|
|
static_configs:
|
|
- targets: ['app:8000']
|
|
scrape_interval: 15s
|
|
metrics_path: '/metrics'
|
|
scrape_timeout: 10s
|
|
honor_labels: true
|
|
params:
|
|
format: ['prometheus']
|
|
|
|
# PostgreSQL metrics
|
|
- job_name: 'postgres'
|
|
static_configs:
|
|
- targets: ['postgres-exporter:9187']
|
|
scrape_interval: 30s
|
|
metrics_path: '/metrics'
|
|
|
|
# Redis metrics
|
|
- job_name: 'redis'
|
|
static_configs:
|
|
- targets: ['redis-exporter:9121']
|
|
scrape_interval: 30s
|
|
metrics_path: '/metrics'
|
|
|
|
# Node exporter for system metrics
|
|
- job_name: 'node'
|
|
static_configs:
|
|
- targets: ['node-exporter:9100']
|
|
scrape_interval: 30s
|
|
metrics_path: '/metrics'
|
|
|
|
# cAdvisor for container metrics
|
|
- job_name: 'cadvisor'
|
|
static_configs:
|
|
- targets: ['cadvisor:8080']
|
|
scrape_interval: 30s
|
|
metrics_path: '/metrics'
|
|
|
|
# Nginx metrics (if using nginx as reverse proxy)
|
|
- job_name: 'nginx'
|
|
static_configs:
|
|
- targets: ['nginx-exporter:9113']
|
|
scrape_interval: 30s
|
|
metrics_path: '/metrics'
|
|
|
|
# Remote write configuration (for long-term storage)
|
|
# remote_write:
|
|
# - url: "http://remote-storage:8086/api/v1/prom/write?db=prometheus"
|
|
|
|
# Storage configuration is handled by command line args in docker-compose
|
|
# --storage.tsdb.retention.time=30d
|
|
# --storage.tsdb.retention.size=10GB
|
|
# --storage.tsdb.path=/prometheus/data
|
|
# --storage.tsdb.wal-compression |