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

ratio with different metrics #839

Closed
mzupan opened this issue Jul 29, 2023 · 2 comments
Closed

ratio with different metrics #839

mzupan opened this issue Jul 29, 2023 · 2 comments

Comments

@mzupan
Copy link

mzupan commented Jul 29, 2023

Is there anyway to do this?

apiVersion: pyrra.dev/v1alpha1
kind: ServiceLevelObjective
metadata:
  name: app-inserts
  labels:
    prometheus: k8s
    role: alert-rules
spec:
  target: '99.99'
  window: 30d
  indicator:
    ratio:
      errors:
        metric: app_primary_insert_failures
      total:
        metric: app_primary_insert_total
      grouping:
        - namespace

That is an app that keeps metrics for total inserts in different prometheus metrics. When I try this I don't get anything on the error budget and errors stay flat at 100% even though all requests were success.

Thanks

edit

seeing this on the frontend

Screenshot 2023-07-29 at 1 34 16 PM
@metalmatze
Copy link
Member

Yes, this should work. In fact, the demo.pyrra.dev has an example using two different metric names:
https://demo.pyrra.dev/objectives?expr=%7B__name__=%22prometheus-rule-evaluation-failures%22,%20team=%22prometheus%22%7D&grouping=%7B%7D

I'm not sure where the frontend error is coming from. If you fix the config itself, does the frontend error persist?

@mzupan
Copy link
Author

mzupan commented Jul 31, 2023

closing this.. i think what happened was the prometheus endpoint was setup to mimir and pyrra was reading the created CRs that never got recording rules setup since that has to be done by hand

@mzupan mzupan closed this as completed Jul 31, 2023
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

No branches or pull requests

2 participants