mirror of
https://github.com/furyhawk/cloudy.git
synced 2026-07-21 02:05:53 +00:00
feat: add Prometheus configuration and enable metrics scraping for Traefik
This commit is contained in:
@@ -162,6 +162,11 @@ services:
|
||||
- --log.level=INFO
|
||||
# Enable the Dashboard and API
|
||||
- --api=true
|
||||
# Enable Prometheus metrics for scraping by Prometheus
|
||||
- --metrics.prometheus=true
|
||||
- --metrics.prometheus.buckets=0.1,0.3,1.2,5.0
|
||||
- --metrics.prometheus.addEntryPointsLabels=true
|
||||
- --metrics.prometheus.addServicesLabels=true
|
||||
networks:
|
||||
# Use the public network created to be shared between Traefik and
|
||||
# any other service that needs to be publicly available with HTTPS
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
volumes:
|
||||
prometheus_data: {}
|
||||
|
||||
configs:
|
||||
prometheus_config:
|
||||
file: ./prometheus/prometheus.yml
|
||||
|
||||
networks:
|
||||
traefik-public:
|
||||
external: true
|
||||
@@ -17,8 +21,10 @@ services:
|
||||
- '--web.enable-lifecycle'
|
||||
volumes:
|
||||
- prometheus_data:/prometheus
|
||||
- /var/data/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||
- /var/data/prometheus/rules:/etc/prometheus/rules:ro
|
||||
configs:
|
||||
- source: prometheus_config
|
||||
target: /etc/prometheus/prometheus.yml
|
||||
networks:
|
||||
- traefik-public
|
||||
deploy:
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# Prometheus configuration for the Swarm stack.
|
||||
# Mounted into the Prometheus container as a Docker config.
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
|
||||
scrape_configs:
|
||||
# Scrape Prometheus itself
|
||||
- job_name: 'prometheus'
|
||||
static_configs:
|
||||
- targets: ['localhost:9090']
|
||||
|
||||
# Scrape Traefik Prometheus metrics
|
||||
# Both services are on the traefik-public overlay network,
|
||||
# so 'traefik' resolves via Swarm DNS.
|
||||
- job_name: 'traefik'
|
||||
static_configs:
|
||||
- targets: ['traefik:8080']
|
||||
metrics_path: /metrics
|
||||
Reference in New Issue
Block a user