Skip to content

bug: promql/fragile should not warn when using without and joining with explicit labelset #1289

@skl

Description

@skl

There is a PromQL alert rule in the kubernetes-mixin for CPUThrottlingHigh which looks like this (abbreviated for readability):

sum without (id, metrics_path, name, image, endpoint, job, node) (
  increase(container_cpu_cfs_throttled_periods_total[5m])
)
/ on (cluster, namespace, pod, container) group_left
sum without (id, metrics_path, name, image, endpoint, job, node) (
  increase(container_cpu_cfs_periods_total[5m])
)
> ( 25 / 100 )

Source:

The warning from pint look like this:

Warning: Aggregation using without() can be fragile when used inside binary expression because both sides must have identical sets of labels to produce any results, adding or removing labels to metrics used here can easily break the query, consider aggregating using by() to ensure consistent labels. (promql/fragile)

I believe that the explicit usage of labels in the join on (cluster, namespace, pod, container) means that this query should not result in a fragile warning.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions