From ec1ef761b9909a1e6774843596807f79d7a8671d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javorek=20D=C3=A9nes?= Date: Mon, 16 Oct 2023 21:24:02 +0200 Subject: [PATCH] fix: tweaks to make /metrics work --- .prometheus/prometheus.yml | 28 ++++++++++++++++++++++++++++ docker-compose.yml | 4 ++++ server/docker/config/app-config.toml | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .prometheus/prometheus.yml diff --git a/.prometheus/prometheus.yml b/.prometheus/prometheus.yml new file mode 100644 index 0000000..3c74c7a --- /dev/null +++ b/.prometheus/prometheus.yml @@ -0,0 +1,28 @@ +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" + +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: ["localhost:9090"] + + - job_name: veryrezsi_server + static_configs: + - targets: ["localhost:3001"] diff --git a/docker-compose.yml b/docker-compose.yml index 67fed79..cde7d09 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,6 +29,9 @@ services: prometheus: container_name: veryrezsi_prometheus image: prom/prometheus + volumes: + - ./.prometheus:/etc/prometheus + command: --config.file=/etc/prometheus/prometheus.yml ports: - 9090:9090 @@ -39,6 +42,7 @@ services: dockerfile: Dockerfile ports: - "8000:8000" + - "3001:3001" depends_on: smtp: condition: service_started diff --git a/server/docker/config/app-config.toml b/server/docker/config/app-config.toml index aff852e..f6c4fc8 100644 --- a/server/docker/config/app-config.toml +++ b/server/docker/config/app-config.toml @@ -10,4 +10,4 @@ smtp_username = "" smtp_password = "" [metrics_config] -metrics_address = "127.0.0.1:3001" +metrics_address = "0.0.0.0:3001"