From 39f2f2eb076c865e58ce9d785f41c23f06b6499f Mon Sep 17 00:00:00 2001 From: Aleksei Palenyi Date: Mon, 2 Jun 2025 12:49:06 +0200 Subject: [PATCH 1/2] Update solution.md Propose a little fix for the query --- labs/promql/solution.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/labs/promql/solution.md b/labs/promql/solution.md index e57678f..8f5370d 100644 --- a/labs/promql/solution.md +++ b/labs/promql/solution.md @@ -28,7 +28,19 @@ avg without(job, status)(rate(fulfilment_requests_total{status="failed"}[5m])) / ### q5- average failure rate by version: ``` -avg without(job, status, instance)(rate(fulfilment_requests_total{status="failed"}[5m]) * on(instance) group_left(app_version) app_info) / avg without(job, status, instance)(rate(fulfilment_requests_total{status="processed"}[5m])* on(instance) group_left(app_version) app_info) +avg without (instance) ( + ( + avg without (job, status) ( + rate( + fulfilment_requests_total{status='failed'}[5m] + ) + ) / avg without (job, status) ( + rate( + fulfilment_requests_total{status='processed'}[5m] + ) + ) + ) * on (instance) group_left(app_version) app_info +) ``` ### Results @@ -40,4 +52,4 @@ You'll see output like this: |`{app_version="1.3.1"}`| `0.04880891333737356`| |`{app_version="1.5.2"}` |`0.1361644759015841`| -Turns out the new version is producing errors at 3X the rate of the old version. Guess we need to rollback the update :) \ No newline at end of file +Turns out the new version is producing errors at 3X the rate of the old version. Guess we need to rollback the update :) From 89d32f40e74607694bb21c252a3409def930f540 Mon Sep 17 00:00:00 2001 From: Aleksei Palenyi Date: Mon, 2 Jun 2025 13:13:41 +0200 Subject: [PATCH 2/2] Remove line break from labs/promql/solution.md