# Prometheus 指标采集(可观测性组件,关键字:prometheus 或组合关键字 obs) # 启动方式:./start.sh obs ... 或 docker compose --env-file .env -f compose/compose-prometheus.yaml up -d(在 deploy/docker 目录执行) # 应用需暴露 /actuator/prometheus 端点才会采集到业务指标 services: bytedesk-prometheus: image: prom/prometheus:latest container_name: prometheus-bytedesk command: - '--config.file=/etc/prometheus/prometheus.yml' - '--storage.tsdb.path=/prometheus' - '--storage.tsdb.retention.time=15d' - '--web.console.libraries=/etc/prometheus/console_libraries' - '--web.console.templates=/etc/prometheus/consoles' - '--web.enable-lifecycle' ports: - '19090:9090' volumes: - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro - prometheus_data:/prometheus networks: - bytedesk-network healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9090/-/healthy"] interval: 30s timeout: 10s retries: 5 volumes: prometheus_data: name: bytedesk_prometheus_data networks: bytedesk-network: driver: bridge