From 26911fa7cb821d3c8f9def5a6ac5bb69b4fda5d7 Mon Sep 17 00:00:00 2001 From: martipoe <130643472+martipoe@users.noreply.github.com> Date: Fri, 17 Jan 2025 18:28:18 +0100 Subject: [PATCH] fix: missing route to prometheus api endpoint via backend in docker-compose setup Resolves the error message "Failed to load the data source configuration for Loki: Unable to fetch alert rules. Is the Loki data source properly configured?" for alert and recording rules in Grafana Alert Overview of docker-compose stack. Signed-off-by: martipoe <130643472+martipoe@users.noreply.github.com> --- production/docker/config/nginx.conf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/production/docker/config/nginx.conf b/production/docker/config/nginx.conf index 90603fafa0775..59da4e03c4a37 100644 --- a/production/docker/config/nginx.conf +++ b/production/docker/config/nginx.conf @@ -23,6 +23,10 @@ http { server loki-write:3100; } + upstream backend { + server loki-backend:3100; + } + upstream cluster { server loki-read:3100; server loki-write:3100; @@ -56,6 +60,10 @@ http { proxy_pass http://write$request_uri; } + location = /loki/api/v1/delete { + proxy_pass http://write$request_uri; + } + location = /loki/api/v1/tail { proxy_pass http://read$request_uri; proxy_set_header Upgrade $http_upgrade; @@ -65,5 +73,9 @@ http { location ~ /loki/api/.* { proxy_pass http://read$request_uri; } + + location ~ /prometheus/api/.* { + proxy_pass http://backend$request_uri; + } } }