Add amtool command for rendering templates.#2414
Closed
FUSAKLA wants to merge 1 commit intoprometheus:mainfrom
Closed
Add amtool command for rendering templates.#2414FUSAKLA wants to merge 1 commit intoprometheus:mainfrom
FUSAKLA wants to merge 1 commit intoprometheus:mainfrom
Conversation
Signed-off-by: Martin Chodur <m.chodur@seznam.cz>
Contributor
Author
|
@simonpasquier if you find a while would you give it a look? 🙏 |
Contributor
|
Attempting to implement a more generic variant here: #2538 |
Member
|
#2538 has been merged. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, I found quite difficult for users to write the Alertmanager templates.
Mainly it's quite difficult to test them.
Now user has to:
I do not think this is much user-friendly and I hope we can do better.
This PR is just draft, because the changes required for it are quite big, so I'm not polishing it and finalizing it but just to show the idea:
The command would generate specified number of synthetic alerts which could be somehow parametrized (add custom annotation, label etc). These will be used for rendering of the templates.
It's bit complicated to specify which templates should be rendered, by default it could render al of them possibly user could filter just specified type, id or name of receiver to render.
The rendered output as should be mainly human readable IMHO (but also reproducible in case someone would want to use it for testing for example.) That's why as initial implementation I did the templating as rendering the receiver config as yaml. That unfortunately required bigger refactoring of the receivers configs templating.
Example tool help
Example usage output:
I'll be happy to finish this but I'm not 100% sure about the ideal form of output and input.
Would you be willing to accept such thing and if so, how should it look like ideally?
Thanks for any ideas!