40 lines
1009 B
YAML
40 lines
1009 B
YAML
global:
|
|
scrape_interval: 15s
|
|
evaluation_interval: 15s
|
|
|
|
rule_files:
|
|
# - "first_rules.yml"
|
|
# - "second_rules.yml"
|
|
|
|
scrape_configs:
|
|
# Prometheus 自身监控
|
|
- job_name: "prometheus"
|
|
static_configs:
|
|
- targets: ["localhost:9090"]
|
|
|
|
# TYAPI 应用监控
|
|
- job_name: "tyapi-server"
|
|
static_configs:
|
|
- targets: ["host.docker.internal:8080"]
|
|
metrics_path: "/metrics"
|
|
scrape_interval: 10s
|
|
|
|
# PostgreSQL 监控 (如果启用了 postgres_exporter)
|
|
- job_name: "postgres"
|
|
static_configs:
|
|
- targets: ["postgres:5432"]
|
|
scrape_interval: 30s
|
|
|
|
# Redis 监控 (如果启用了 redis_exporter)
|
|
- job_name: "redis"
|
|
static_configs:
|
|
- targets: ["redis:6379"]
|
|
scrape_interval: 30s
|
|
|
|
# Docker 容器监控 (如果启用了 cadvisor)
|
|
- job_name: "docker"
|
|
static_configs:
|
|
- targets: ["host.docker.internal:8080"]
|
|
metrics_path: "/docker/metrics"
|
|
scrape_interval: 30s
|