Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fuser-guides%2Fslos%2Frecording-rule-based-metrics.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fuser-guides%2Fslos%2Frecording-rule-based-metrics.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# Safe use of recording rule–based metrics and event2metrics in SLOs

Coralogix SLOs can be powered by metrics derived from Prometheus recording rules or from [Event2Metrics-generated metrics](https://docs-docusaurus.kinsta.page/user-guides/monitoring-and-insights/events2metrics/.md). When those metrics come from chained recording rules—where one rule depends on another—there’s a risk of inaccurate evaluations.

This guide explains:

* Why metric-generation processes (chained recording rules or E2M) can cause incomplete or premature SLO results.
* How to safely use recording rule–based metrics in your SLOs.
* How to apply the PromQL `offset` modifier to ensure evaluation accuracy.

## Why chained recording rules can introduce errors[​](#why-chained-recording-rules-can-introduce-errors "Direct link to Why chained recording rules can introduce errors")

In chained setups, a downstream recording rule may run before its upstream recording rule or E2M has finished writing data. This timing mismatch can cause the downstream rule to persist incomplete values, which are then used in the SLO. The result: inaccurate or misleading SLO evaluations.

## The solution: Apply an `offset`[​](#the-solution-apply-an-offset "Direct link to the-solution-apply-an-offset")

To avoid this issue, apply a PromQL `offset` to your SLO query. The `offset` shifts the evaluation window backward, ensuring all dependent data is fully materialized before being used.

For example:

```
increase(my_recorded_metric offset 2m)
```

Meaning: "Calculate the increase in `my_metric` as if the evaluation ended two minutes ago." This avoids the newest interval, where dependent computations (recording rules or E2M) may not yet be finalized.

This is especially useful in situations where the most recent data might not yet be complete—such as with recording rules or E2M, which can have slight delays in updating. Applying an offset (for example, `2m`) helps avoid premature or inaccurate evaluations, particularly in time-sensitive use cases like SLOs.

## Query examples[​](#query-examples "Direct link to Query examples")

The examples below are applicable to recording rule-based metrics within an SLO query (`RR_based_metric`), but can be implemented in the same manner also when using an `E2M_based_metric`.

### Basic total events (no filter)[​](#basic-total-events-no-filter "Direct link to Basic total events (no filter)")

Without `offset`:

```
sum(increase(RR_based_metric)) by (service_name)
```

With `offset`:

```
sum(increase(RR_based_metric offset 2m)) by (service_name)
```

### Good events (with filter)[​](#good-events-with-filter "Direct link to Good events (with filter)")

Without `offset`:

```
sum(increase(RR_based_metric{status!="error"})) by (service_name)    
```

With `offset`:

```
sum(increase(RR_based_metric{status!="error"} offset 2m)) by (service_name)   
```

### Compound query 1[​](#compound-query-1 "Direct link to Compound query 1")

Without `offset`:

```
sum(increase(RR_based_metric_successes)) by (service_name)

+

sum(increase(RR_based_metric_failures)) by (service_name)    
```

With `offset`:

```
sum(increase(RR_based_metric_successes offset 2m)) by (service_name)

+

sum(increase(RR_based_metric_failures offset 2m)) by (service_name)    
```

### Compound query 2[​](#compound-query-2 "Direct link to Compound query 2")

Without `offset`:

```
sum(increase(RR_based_metric_successes) + increase(RR_based_metric_failures)) by (service_name)    
```

With `offset`:

```
sum(increase(RR_based_metric_successes offset 2m) + increase(RR_based_metric_failures offset 2m)) by (service_name)    
```

## Next steps[​](#next-steps "Direct link to Next steps")

Track and manage your SLOs from a centralized dashboard in [View and manage Service Level Objectives](https://docs-docusaurus.kinsta.page/user-guides/slos/view-and-manage-slo/.md).
