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.
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