Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autogenerate a "real" set of rules files consumable by prometheus #110

Open
robert-will-brown opened this issue Apr 30, 2020 · 8 comments
Open

Comments

@robert-will-brown
Copy link
Contributor

robert-will-brown commented Apr 30, 2020

Copy and pasting these rules is ok, but it would be easier if there was a generated set of rules files from rules.yml that would "just work".

Is there any reason this isn't generated? If not are there any templating tools that anyone knows of that could achieve this?

@paulfantom
Copy link

paulfantom commented Apr 30, 2020

A lot of alerting rules here are taken from monitoring mixin projects (which produce "real" rule files). For more, you can see for example following sub-projects:

Mixins are what prometheus community agreed on to provide a customizable package containing recording rules, alerts, and grafana dashboards. For more info on mixins you can read in https://github.com/monitoring-mixins/docs

And mixins can be combined together and inherited. One example of more advanced use-case could be seen in https://github.com/coreos/kube-prometheus project.

@robert-will-brown
Copy link
Contributor Author

Thanks for the info, I’ll have a look.

@robert-will-brown
Copy link
Contributor Author

Hey @paulfantom, so I've looked at these and are non the wiser for it! Are you suggesting that it would be a good idea or bad idea to also produce some immediately useable templates?

If good idea, then I can't immediately see how these mixins help get the rules.yml file into a usable collection of prometheus consumable YAML files?

@paulfantom
Copy link

paulfantom commented May 4, 2020

Are you suggesting that it would be a good idea or bad idea to also produce some immediately useable templates?

Mixins are written in jsonnet language, which allows overriding any parameter, so I don't see any benefit of using templating. It isn't the easiest path to follow but provides the best customizability options, which is quite important when someone creates a library (which mixins classify as).

If good idea, then I can't immediately see how these mixins help get the rules.yml file into a usable collection of prometheus consumable YAML files?

If you mean rules.yml file from this repository, then they don't. I was pointing you to an already established "standard" of sharing alerts, recording rules, and dashboards instead of inventing "brand new thing" and rewriting this repository.
And if you want to create "brand new thing", please read design doc of monitoring-mixins and thing what would be the maintenance toll if templating was introduced in this repository.


In the end it is @samber decision if he wants this repository to be a guideline (as it is now) or a library (if templating was introduced). :)

@b-a-t
Copy link

b-a-t commented Jan 29, 2022

I think this issue deserves to be in the README.md or around. I also was wondering why even code snippets are not directly usable in the configs and now I see why. But how many still do have this question?

@samber
Copy link
Owner

samber commented Dec 4, 2022

You can run wget https://raw.githubusercontent.com/samber/awesome-prometheus-alerts/master/dist/rules/kafka/danielqsj-kafka-exporter.yml.

Anyway, a better tooling should be used when available.

@sjentzsch
Copy link

sjentzsch commented Aug 2, 2023

@samber I also stumbled upon this: So far I saw awesome-prometheus-alerts as a collection of links to various mixins, however, it became more; we somewhat re-do the work. For example, the node-exporter alerts within this repo have nothing to do with the node-exporter mixin alerts (https://github.com/prometheus/node_exporter/blob/master/docs/node-mixin/alerts/alerts.libsonnet). Yes, they are related, probably inspired, maybe derived from the mixin, they are partly even much better, but they are completely different (starting with the naming already).

As a user, I wonder what awesome-prometheus-alerts will become. Even so, to which project I should commit my shiny-and-great alert that I have for a component: This repo, or the related upstream-mixin? Do they complement each other, do they compete against each other? Now I would always compare, e.g. for Thanos: What has the upstream mixin to offer, what is in this repo, render both to manifests, run a diff - and then basically merge manually.

No criticism at all, but maybe indeed it would be good to have some statements on the philosophy of this repo right inside the README.

@dudicoco
Copy link

dudicoco commented Aug 3, 2023

I agree with @sjentzsch.

Rather than diverging from the upstream mixin projects it would be much better if this project would just unify all of these projects in one place without altering them and add any other missing mixins for different categories (redis, kafka etc.) which might not have existing mixin projects.

Enhancements should be contributed to the upstream projects so we as the users can enjoy well maintained sets of rules.

The way this can be achieved is by setting up a sync job which fetches upstream changes daily (I believe the prometheus-operator project does that) and making sure these changes are not modified.

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

No branches or pull requests

6 participants