-
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 sprig template functions #3770
Conversation
9cb7ae1
to
9f54419
Compare
Looks like circleci has a problem :( |
can I get a review @gotjosh |
7872000
to
5a449ad
Compare
189905b
to
bb6eb2e
Compare
Also I noticed the code is actually prepared to allow for users to pass custom functions to the templating. But that is not accessible from what I have seen in code and docs. |
This is all internal code. Users cannot add their own functions without changing and re-compiling the code. |
@grobinson-grafana, @TheMeier, how can we speed up the review of this PR? The functionality to be added, if this PR is accepted, will eliminate a large number of existing limitations. For example, time-related functions will allow for creating links to Grafana dashboards with a time range tied to the time the alert was triggered. |
The only ones who can help here are the maintainers. I guess they are busy with other stuff, so you just have to wait |
Yep, I'll be hoping that they can find the time. This feature would indeed be very useful. |
While we figure out whether or not to accept sprig, I've opened a PR that adds much requested date and timezone functions here. |
703b7de
to
0bf2b90
Compare
f2565c9
to
c2986cd
Compare
fixes prometheus#3726 fixes prometheus#3762 fixes prometheus#603 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
I've spent some time thinking about this and my preference is that we don't add Sprig. Instead, we implement template functions as needed. We can also implement the most common functions in The reasons I don't think we should add Sprig are the following:
|
@grobinson-grafana your points are all valid, but it is missing a bit of context IMHO:
The 11 extra dependencies are a very good reason not to go this route though. |
fixes #3726
fixes #3762
fixes #603