sloth icon indicating copy to clipboard operation
sloth copied to clipboard

Extra labels for SLO meta recordings

Open SuperQ opened this issue 3 years ago • 0 comments

We use Thanos Ruler/Query to query data longer than 24h. In order to reduce fanout to different Prometheus instances, it would be useful to be able to inject extra labels on the SLO meta recording rules.

For example:

 slo:sli_error:ratio_rate30d{sloth_id=".,.",sloth_service="...",sloth_slo="..."}

Becomes:

 slo:sli_error:ratio_rate30d{prom_external_label="my_namespace",sloth_id=".,.",sloth_service="...",sloth_slo="..."}

I was thinking would only need to be a top-level spec key like extra_query_labels. We don't need this injected into the errorQuery or totalQuery, we do this on our side. But we need to manipulate the generated queries.

SuperQ avatar Jul 14 '22 12:07 SuperQ