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

Failed to get objective: ratio error metric is not a VectorSelector #1387

Open
harleyharl opened this issue Jan 20, 2025 · 0 comments
Open

Comments

@harleyharl
Copy link

harleyharl commented Jan 20, 2025

Hello,
I'm trying to use Pyrra to create SLOs for some web vitals I'm trying to track in Grafana.

This is one of my definitions (most of them look similar to this):

apiVersion: pyrra.dev/v1alpha1
kind: ServiceLevelObjective
metadata:
  name: my-site-web-vitals-lcp
  namespace: monitoring
  labels:
    prometheus: k8s
    role: alert-rules
    pyrra.dev/team: webservices
    pyrra.dev/ns: my-site
    pyrra.dev/service: WebVitals
    pyrra.dev/tier: "2"
spec:
  target: "95"
  window: 4w
  description: Largest Contentful Paint should be under 2.5s
  indicator:
    ratio:
      errors:
        metric: web_vitals_lcp{job="mysite.com"} > 2500
      total:
        metric: web_vitals_lcp{job="mysite.com"}

And the error I'm seeing in the pyrra logs

2025-01-21T12:25:18+13:00 2025-01-20T23:25:18.578176201Z stderr F 2025-01-20T23:25:18Z ERROR Reconciler error {"controller": "servicelevelobjective", "controllerGroup": "pyrra.dev", "controllerKind": "ServiceLevelObjective", "ServiceLevelObjective": {"name":"mysite-web-vitals-lcp","namespace":"monitoring"}, "namespace": "monitoring", "name": "mysite-web-vitals-lcp", "reconcileID": "1a8605c4-cbf8-46e7-8b5f-db83ee655c55", "error": "failed to get objective: ratio error metric is not a VectorSelector"}

I realise my metrics are incorrect but I don't know how to properly structure this to make it correct.

According to this:
https://github.com/pyrra-dev/pyrra/blob/932af2bb679e332520deeb5cf33b021942a0834b/examples/openshift/manifests/setup/pyrra-slo-CustomResourceDefinition.yaml

The value for metric is only required to be a string so I'm unsure what is acceptable here?

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

1 participant