pyrra icon indicating copy to clipboard operation
pyrra copied to clipboard

Pyrra - Sloth integration

Open verejoel opened this issue 2 years ago • 5 comments

This might be better suited as a separate project. But it could be cool if the Pyrra api layer was able to also watch for Sloth manifests, and report them in a similar way to Pyrra SLOs.

verejoel avatar May 24 '23 07:05 verejoel

Interesting use case. I would want to avoid integrating Pyrra with all sorts of other projects directly for now. I think another project is probably the way to go indeed.

metalmatze avatar May 26 '23 19:05 metalmatze

I do enjoy Sloths ability to create multiple SLOs for a single service.

sstarcher avatar Aug 09 '23 13:08 sstarcher

Not having closely looked at how Sloth does it, this should be possible with Pyrra too. You could for example use a pyrra.dev/service=my-service label in the config and then filter based on those attached labels. Is there something more to it, that I'm missing?

metalmatze avatar Aug 09 '23 15:08 metalmatze

ya, that would work it's just first class in sloth as service is a top level object and than you have an array of SLOs

  service: "myservice"
  labels:
    owner: "myteam"
    repo: "myorg/myservice"
    tier: "2"
  slos:
    - name: "requests-availability"
      objective: 99.9
      description: "Common SLO based on availability for HTTP request responses."
      sli:
        events:
          errorQuery: sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[{{.window}}]))
          totalQuery: sum(rate(http_request_duration_seconds_count{job="myservice"}[{{.window}}]))
      alerting:
        name: MyServiceHighErrorRate
        labels:
          category: "availability"
        annotations:
          summary: "High error rate on 'myservice' requests responses"
        pageAlert:
          labels:
            severity: pageteam
            routing_key: myteam
        ticketAlert:
          labels:
            severity: "slack"
            slack_channel: "#alerts-myteam"

sstarcher avatar Aug 09 '23 15:08 sstarcher

I see! Thanks for posting this above. While I see how we could create some higher abstraction to group SLOs for each service, I strongly believe that what we have is more flexible and filtering for a service label should do the trick the same.

metalmatze avatar Aug 10 '23 12:08 metalmatze