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 :)