You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A cortex rule with the following content always shows changes:
name: watchdog
rules:
- alert: watchdog
expr: >
series_a or on (label)
(
series_b
)
Details
The Cortex API returns the alert in the following format (note the additional new line) and usage of literal style | instead of folded style >:
name: watchdog
rules:
- alert: watchdog
expr: |
series_a or on (label)
(
series_b
)
The current DiffSurpressFunc for the cortex_rule resource detects a different due to the additional newlines in the expr field.
Suggested fix
#14 updates the DiffSurpressFunc to use cortex-tools packages to compare rule groups. This could 1) be extended to normalise alerting expressions using Prometheus' promql parsing packages.
The text was updated successfully, but these errors were encountered:
After digging into this a bit more it seems to be an issue with go-yaml's handling of folded style yaml (i.e the > multi-line style) - go-yaml/yaml#804. Debugging the provider, the change in alert format can be seen before the alert is sent to the Cortex API.
Observed
A cortex rule with the following
content
always shows changes:Details
The Cortex API returns the alert in the following format (note the additional new line) and usage of literal style
|
instead of folded style>
:The current
DiffSurpressFunc
for thecortex_rule
resource detects a different due to the additional newlines in theexpr
field.Suggested fix
#14 updates the
DiffSurpressFunc
to use cortex-tools packages to compare rule groups. This could 1) be extended to normalise alerting expressions using Prometheus' promql parsing packages.The text was updated successfully, but these errors were encountered: