pyrra-dev / pyrra

Making SLOs with Prometheus manageable, accessible, and easy to use for everyone!
https://demo.pyrra.dev
Apache License 2.0
1.25k stars 113 forks source link

feat: add support for offset #1238

Closed fstr closed 1 month ago

fstr commented 3 months ago

Description

Add support for Prometheus offset modifier in indicator metric expressions.

Use Case

AWS CloudWatch ELB metrics are reported with a 5-10 minute delay. A Prometheus recording rule is evaluated at the current time, at which you will never have AWS ELB metrics in your Prometheus.

This can be solved by applying an offset 10m to the metric. All PromQL statements that use the recording rules don't need to have the offset applied. When the offset is used in the metric for the recording rule, everything is already recorded with the defined offset.

The offset is not great for fast burning alerts but I prefer to have a slightly delayed but working SLO over no SLO. There can also be other use cases where users benefit from applying a (shorter) offset.

If no offset is provided, everything works as before.

This solves #1237

fstr commented 1 month ago

Closing. The maintainer prefers to not have this functionality in Pyrra. See https://github.com/pyrra-dev/pyrra/issues/1237.