-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add extensive templating helpers based on Masterminds/sprig #3726
Comments
fixes prometheus#3726 fixes prometheus#3762 fixes prometheus#603
fixes prometheus#3726 fixes prometheus#3762 fixes prometheus#603 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
fixes prometheus#3726 fixes prometheus#3762 fixes prometheus#603 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
fixes prometheus#3726 fixes prometheus#3762 fixes prometheus#603 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
fixes prometheus#3726 fixes prometheus#3762 fixes prometheus#603 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
fixes prometheus#3726 fixes prometheus#3762 fixes prometheus#603 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
fixes prometheus#3726 fixes prometheus#3762 fixes prometheus#603 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
fixes prometheus#3726 fixes prometheus#3762 fixes prometheus#603 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
fixes prometheus#3726 fixes prometheus#3762 fixes prometheus#603 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
fixes prometheus#3726 fixes prometheus#3762 fixes prometheus#603 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
fixes prometheus#3726 fixes prometheus#3762 fixes prometheus#603 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
A thumbsup does to not do justice to how badly I want this to be added. |
fixes prometheus#3726 fixes prometheus#3762 fixes prometheus#603 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
fixes prometheus#3726 fixes prometheus#3762 fixes prometheus#603 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
fixes prometheus#3726 fixes prometheus#3762 fixes prometheus#603 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
fixes prometheus#3726 fixes prometheus#3762 fixes prometheus#603 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
I'll share what I wrote in #3770:
And just to make sure there is no misunderstanding, I think we do need to add more useful functions to templates. But I think we should add our own, and not be dependent on another package for it (whether Sprig or something else). |
@grobinson-grafana makes sense. Would it make sense to collect a subset of "safe" sprig functions that we could add as an initial set? |
Hi! 👋 Please feel free to put together a list of template functions that you think are missing. These shouldn't be functions copied from Sprig verbatim, but think about the kind of functions you are missing when writing templates in Alertmanager. It might be easier to pretend that Sprig doesn't exist 🙂 |
@oncilla that approach is already implemented in proposed PR. |
@TheMeier ack. But AFAICS, you are still importing sprig. If I understand @grobinson-grafana correctly, he wants to have an original implementation in alertmanager code, rather than importing it. (I'm not agreeing with the point FWIW) |
@oncilla I misunderstood your comment, makes sense now |
When writing custom templates, the current set of functions is fairly limited.
We could register the functions from https://github.com/Masterminds/sprig to offer the template authors an extensive set of helper functions. Docs of the functions is available here: https://masterminds.github.io/sprig/
If you are interested, I would be happy to send a patch.
The text was updated successfully, but these errors were encountered: