Giter Club home page Giter Club logo

Comments (7)

metalmatze avatar metalmatze commented on June 23, 2024 2

Glad you found a solution!
--generic-rules actually only works on the filesystem, kubernetes or generate sub commands. It doesn't work on the default api command as that one only serves APIs and UIs and never generates anything.

from pyrra.

Rohlik avatar Rohlik commented on June 23, 2024 1

Are you using it correctly 🤔? I got same error only if I use it wrongly, like:

$ docker run -ti ghcr.io/pyrra-dev/pyrra:v0.7.0  --generic-rules
pyrra: error: unknown flag --generic-rules

If I use it in correct way, then there is no such an error:

$ docker run -ti ghcr.io/pyrra-dev/pyrra:v0.7.0 generate --generic-rules
level=info ts=2023-10-25T13:27:24.404827723Z caller=main.go:142 msg="using Prometheus" url=http://localhost:9090

from pyrra.

Rohlik avatar Rohlik commented on June 23, 2024

Maybe it would be great to specify which image/chart you are using 🙄.

from pyrra.

tech1ndex avatar tech1ndex commented on June 23, 2024

Oh sorry about that, I am just using the ghcr.io/pyrra-dev/pyrra:v0.7.0 image that is deployed as part of your kubernetes examples

from pyrra.

tech1ndex avatar tech1ndex commented on June 23, 2024

Yup, looks like that was it. I have an issue with the structure of my generic-rules.yaml file now it looks like :

level=info ts=2023-10-25T13:43:47.683319981Z caller=main.go:142 msg="using Prometheus" url=http://localhost:9090
level=error ts=2023-10-25T13:43:47.684517622Z caller=generate.go:33 msg="generating rule files" err="failed to get objective: failed to unmarshal objective \"/etc/pyrra/generic-rules.yaml\": error unmarshaling JSON: while decoding JSON: json: unknown field \"recordingRules\

but at least was able to progress, thanks!

from pyrra.

Rohlik avatar Rohlik commented on June 23, 2024

The structure should look like:

apiVersion: pyrra.dev/v1alpha1
kind: ServiceLevelObjective
metadata:
  name: loki-availability
  namespace: monitoring
  labels:
    release: k8s
    role: alert-rules
spec:
  description: Loki availability based on duration of requests
  target: "99"
  window: 7d
  indicator:
    ratio:
      errors:
        metric: loki_request_duration_seconds_count{namespace="monitoring", job="loki-querier", status_code=~"5[0-9]{2}"}
      total:
        metric: loki_request_duration_seconds_count{namespace="monitoring", job="loki-querier"}

If you are happy with the solution of this issue, then you can proceed with closing this ticket.

from pyrra.

tech1ndex avatar tech1ndex commented on June 23, 2024

Awesome, thanks! Will close now.

from pyrra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.