Add alerts.libsonnet for generic alert patching, filtering and rendering - #13
Conversation
HappyTetrahedron
left a comment
There was a problem hiding this comment.
LGTM. My brain's a bit too addled to look at the patching logic in detail so I primarily verified that the tests test the right things and the golden file looks as it should. afaiu the logic stayed the same as in component-openshift4-monitoring, right?
Wouldn't want to break the foo generator pipeline 🙃
This is the core logic of `prom.generateRules()` which is completely distribution-independent.
Yeah, logic is copied from openshift4-monitoring and almost identical (I've added a call to |
….libsonnet` We've moved the core logic of `openshift4-monitoring-alert-patching.libsonnet` and `prom.generateRules()` to `projectsyn/jsonnet-libs` (cf. projectsyn/jsonnet-libs#13). This commit updates the compnent to use that generic library.
….libsonnet` We've moved the core logic of `openshift4-monitoring-alert-patching.libsonnet` and `prom.generateRules()` to `projectsyn/jsonnet-libs` (cf. projectsyn/jsonnet-libs#13). This commit updates the compnent to use that generic library.
The new
alerts.libsonnetis a cleaned up copy of component-openshift4-monitoring'sopenshift4-monitoring-alert-patching.libsonnet+ the core rendering logic ofopenshift4-monitoring-prom.libsonnet'sgenerateRules()asrenderRules().The idea is that monitoring components can re-export this library with their global alert config parameter injected into field
global_alert_paramsas follows:Checklist
changelog.
The PR has a meaningful description that sums up the change. It will be
linked in the changelog.
bug,enhancement,documentation,change,breaking,dependencyas they show up in the changelog.