Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect array length in mergeAlignedData #1424

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tobikris
Copy link

@tobikris tobikris commented Mar 6, 2025

We had the same issue as #1130. I tried to find the minimum reproducible example:

apiVersion: pyrra.dev/v1alpha1
kind: ServiceLevelObjective
metadata:
  name: prometheus-api-query
  namespace: monitoring
  labels:
    prometheus: k8s
    role: alert-rules
spec:
  target: "99.0"
  window: 7d
  indicator:
    ratio:
      errors:
        metric: prometheus_http_requests_total{handler=~"/.*", code=~"5.."}
      total:
        metric: prometheus_http_requests_total{handler=~"/.*"}

Adding the handler to the example SLO triggers the issue on every UI load for me.

I don't fully understand the code, but I guess that the logic can be improved in a better way to not rely on the hacky loop extending the array just enough.

Anyway, I wanted to share my finding and a workaround at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant