From c654011aefaa84221cc9731c5e61650634ad52bd Mon Sep 17 00:00:00 2001 From: Augustin Husson Date: Mon, 22 Apr 2024 17:06:46 +0200 Subject: [PATCH] deploy prometheus Signed-off-by: Augustin Husson --- docker-compose.yaml | 7 ++++++- prometheus.yml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 prometheus.yml diff --git a/docker-compose.yaml b/docker-compose.yaml index ecf164f..8f3b27c 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -48,7 +48,12 @@ services: # The domain the service will respond to - "traefik.http.routers.demo.rule=Host(`demo.perses.dev`)" - "traefik.http.routers.demo.tls.certresolver=myresolver" - + prometheus: + image: "docker.io/prom/prometheus:v2.51" + ports: + - "9090:9090" + volumes: + - ./prometheus.yml:/etc/prometheus/prometheus.yml traefik: image: "docker.io/traefik:v2.9.10" command: diff --git a/prometheus.yml b/prometheus.yml new file mode 100644 index 0000000..ab962bc --- /dev/null +++ b/prometheus.yml @@ -0,0 +1,31 @@ +# my global config +global: + scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. + evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. + # scrape_timeout is set to the global default (10s). + +# 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" + + # metrics_path defaults to '/metrics' + # scheme defaults to 'http'. + static_configs: + - targets: ["prometheus:9090"] + - job_name: "perses" + static_configs: + - targets: ["demo:8080"]