Skip to content

Conversation

@malcolmholmes
Copy link
Contributor

A simple library for rendering Prometheus rules. Provides a workaround for the issue that patching Prometheus alerts/recording rules is hard in Jsonnet, as individual elements in a list are not addressable. Under the bonnet, this stores rules in a map, then renders the required list late. The entries in the map can be patched, as demonstrated in the example patch.jsonnet.

Comments/thoughts/approvals welcome.

Copy link
Contributor

@beorn7 beorn7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from my side. Jsonnet and general config language experts might still have something to say about this.

Copy link
Contributor

@Duologic Duologic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concise, love it!

Comment on lines 6 to 7
recording rules after the fact. (With lists, this requires iteration, and
is complex.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
recording rules after the fact. (With lists, this requires iteration, and
is complex.
recording rules after the fact, in contrast, lists require complex iteration logic.

@malcolmholmes malcolmholmes merged commit 8bcf35d into master Oct 20, 2020
@malcolmholmes malcolmholmes deleted the add-promsonnet-lib branch October 20, 2020 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants