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
feat: add time template helpers #627
base: main
Are you sure you want to change the base?
feat: add time template helpers #627
Conversation
a629df0
to
ca27390
Compare
@gotjosh can you look at this? |
a6324bf
to
b0dc45a
Compare
Signed-off-by: Sergey <freak12techno@gmail.com>
Signed-off-by: Sergey <freak12techno@gmail.com>
Signed-off-by: Sergey <freak12techno@gmail.com>
Signed-off-by: Sergey <freak12techno@gmail.com>
b0dc45a
to
270171b
Compare
Hi @freak12techno, in the old PR prometheus/alertmanager#3720 you also included time.since. Is it possible to add here? |
@LMantovan I'll still need to make a PR towards alertmanager to use this template, my plan is to add time.Since in the next PR which will supersede the one I closed. This one needs to be merged first regardless though. |
@gotjosh ping? |
@gotjosh are you up to reviewing this? Either way, could you comment so that we at least know you have seen this PR? |
Copied from here https://github.com/prometheus/prometheus/blob/34ee8c607809cca973a1d7383713035045f681d8/template/template.go#L267, the eventual goal is to reuse it in Alertmanager as well to allow it as a template helper, and also in Prometheus.
Related: prometheus/alertmanager#3717
Related: prometheus/alertmanager#3720 (comment)
Function itself is moved as is, tests are updated as there's no templates rendering here.
Also
added theadded the go.mod entry to go.mod and go.sum (otherwise.idea
to.gitignore
(as I use Goland IDE and it creates some files that are probably not to be committed) andmake test
would fail).