Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions labs/promql/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 :)
Turns out the new version is producing errors at 3X the rate of the old version. Guess we need to rollback the update :)