pollypkg / polly

Parameterized Observability Packages
https://pollypkg.github.io/polly/
Apache License 2.0
84 stars 8 forks source link

cert-manager example (community hack session) #21

Closed sdboyer closed 3 years ago

sdboyer commented 3 years ago

Started working on converting this cert-manager mixin in a community hack session. Thanks to @rgeyer for his great questions!

Only got to one alert and a bunch of discussion around it, but that's OK!

Interesting possible change in here, though - this changes the structure of PollyPackage to make rules and alerts more addressable from the outside. That is, instead of having a list, they're effectively all in a string-keyed map.

This is an approach to the grouping problem i described to in #16. It does mean consuming tools will need to transform the alerts and rules in order to get them in the list form that Prom expects to see them - but i think that's acceptable. Thoughts, @metalmatze?

/cc @malcolmholmes - i know you wanted to map-ify these lists long, long ago

sdboyer commented 3 years ago

Will continue work on this on Friday

paulfantom commented 3 years ago

It does mean consuming tools will need to transform the alerts and rules in order to get them in the list form that Prom expects to see them - but i think that's acceptable.

We'll need that tool (or good, documented examples) as part of polly org if we want to have widespread adoption.

sdboyer commented 3 years ago

We'll need that tool (or good, documented examples) as part of polly org if we want to have widespread adoption.

Absolutely. I think the target here is probably docs + CUE helpers (i'm imagining more things in the "util" vein described over here) + impl in some tools.

I think the helpers will probably be most useful. Any translation layer that exists must necessarily start by consuming a pop, which likely means starting from the [Go] CUE SDK, where it will be possible to rely on these helpers directly. That means the option will always be there to have the alerts/rules arrive in the userspace for that tool (e.g. HCL for terraform, jsonnet files for jsonnet) in the canonical Prometheus form of a list. It may not be the best option for users, but having the CUE util bit should make it available, in a standard way, for any consuming toolchain, and the author of that consumer gets to make their own UX judgment.

sdboyer commented 3 years ago

OK, this is ready to go. All the alerts and the grafana dashboard are there. Some notes: