pyrra-dev / pyrra

Making SLOs with Prometheus manageable, accessible, and easy to use for everyone!
https://demo.pyrra.dev
Apache License 2.0
1.26k stars 113 forks source link

POC for Azure Managed Prometheus Support #1189

Closed bbrandt closed 1 week ago

bbrandt commented 6 months ago

A number of things are hard-coded or otherwise broken, but this was able to create both recording and alerting rules.

Do not merge. This draft PR is just to gauge interest. I got this out fast and dirty because I am about to hop on a plane for a couple weeks for vacation. If you have questions or comments, I will not be responding until after June 12th.

Azure SDK for go in use here is a preview release.

metalmatze commented 5 months ago

Hey! Thank you so much for working on this PoC! Is there a reason this code needs to be specific to a cloud provider? Pyrra has a pyrra generate command, and I'm wondering how much this could be reused rather than building something entirely new.

bbrandt commented 4 months ago

Yes. An option or flag for Azure-specific on pyrra generate would work. The main trouble is all Azure's fault. They do not currently support the standard approaches for defining prometheus recording and alerting rules via yaml. They are using their own proprietary JSON format as the file-based approach to defining these and support a couple other ways like with their APIs/SDKs.

https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/prometheus-rule-groups#create-prometheus-rules

This POC is on hold for me as I evaluate if our group wants to go with a paid solution for SLO management or role our own with open source and the cloud tools we currently have. But if anyone else wants to continue this work, ping me.