From 3b71873cbce40516884b0b3b6082cb540152acc6 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Mon, 1 Jun 2026 12:27:11 +0200 Subject: [PATCH] feat: add prometheus docker compose configuration --- docker-compose.prometheus.yml | 47 +++++++++++++++++++++++++++++++++++ prometheus/prometheus.yml | 30 ++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 docker-compose.prometheus.yml create mode 100644 prometheus/prometheus.yml diff --git a/docker-compose.prometheus.yml b/docker-compose.prometheus.yml new file mode 100644 index 0000000..b449bb9 --- /dev/null +++ b/docker-compose.prometheus.yml @@ -0,0 +1,47 @@ +version: '3.8' + +services: + prometheus: + image: prom/prometheus:v2.44.0 + container_name: prometheus + restart: unless-stopped + ports: + - "9090:9090" + volumes: + - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml + - prometheus_data:/prometheus + command: + - '--config.file=/etc/prometheus/prometheus.yml' + - '--storage.tsdb.path=/prometheus' + - '--web.console.libraries=/etc/prometheus/console_libraries' + - '--web.console.templates=/etc/prometheus/consoles' + - '--storage.tsdb.retention.time=200h' + - '--web.enable-lifecycle' + networks: + - monitoring + + grafana: + image: grafana/grafana-enterprise + container_name: grafana + restart: unless-stopped + ports: + - "3000:3000" + volumes: + - grafana_data:/var/lib/grafana + - ./grafana/provisioning:/etc/grafana/provisioning + environment: + - GF_SECURITY_ADMIN_USER=admin + - GF_SECURITY_ADMIN_PASSWORD=admin + - GF_USERS_ALLOW_SIGN_UP=false + networks: + - monitoring + depends_on: + - prometheus + +volumes: + prometheus_data: + grafana_data: + +networks: + monitoring: + driver: bridge \ No newline at end of file diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml new file mode 100644 index 0000000..bd9fe5c --- /dev/null +++ b/prometheus/prometheus.yml @@ -0,0 +1,30 @@ +# Global configuration +global: + scrape_interval: 15s + evaluation_interval: 15s + +# Alertmanager configuration +alerting: + alertmanagers: + - static_configs: + - targets: + # - alertmanager:9093 + +# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. +rule_files: + # - "first_rules.yml" + # - "second_rules.yml" + +# A scrape configuration containing exactly one endpoint to scrape: +# Here it's Prometheus itself. +scrape_configs: + # The job name is added as a label `job=` to any timeseries scraped from this config. + - job_name: "prometheus" + static_configs: + - targets: ["localhost:9090"] + + # Hermes Agent metrics + - job_name: "hermes-agent" + static_configs: + - targets: ["172.17.0.1:8000"] + scrape_interval: 15s \ No newline at end of file