Open toby181 opened 1 month ago
@tacole02 Can you have a look at this to verify that the docs are correct? If so we will need to then fix the code.
@armandgrillet , sure, I'll take a look!
Hi @toby181
@eamonryan kindly helped me to test this and find out what the issue was. If you look at the example under "Load AlertManager configuration" on this page, this is the input it expects:
mimirtool alertmanager verify <config_file> [template_files...]
with the .tpl file as optional input.
It looks like when you tested these configs, you didn't also include the alertmanager_config.yaml
file before the template file. Doing so should work as expected.
Let me know if this helps!
@toby181 Can you confirm the solution outlined by @tacole02 works? We will close this item soon.
Hi guys,
you're right @tacole02 , I did it without the alertmanager_config.yaml. Thanks!
The command mimirtool alertmanager verify alertmanager_config.yaml alertmanager_template.tpl
works.
But does it actually verify the alertmanager_template.tpl
? For alertmanager_config.yaml
it actually checks the syntax.
Cause when I remove the {{ end }}
it still passes.
{{ define "alert_customer_env_message" }}
[{{ .CommonLabels.alertname }} | {{ .CommonLabels.customer }} | {{ .CommonLabels.environment }}]
Hi, Toby, I'm so glad the command worked!
I'm not sure about how the command itself is implemented and whether it verifies the syntax of the template file. @armandgrillet , do you know who we could check this with?
Thanks!
@armandgrillet, I believe this one is yours now and I'll remove it from Docs team (Grafana Labs wide)
Describe the bug
We're evaluating the mimirtool to verify / load the configuration and notification templates for the Alertmanager, using examples that are provided in the documentation. Doing so for the provided Alertmanager config works, doing the same for the provided notification policy fails with the exception "mimirtool: error: yaml: line 2: found character that cannot start any token, try --help".
Trying some other template will mostly result in "line 1: cannot unmarshal !!map into string".
To Reproduce
Steps to reproduce the behavior:
Verifying the Alertmanager configuration works, having this:
alertmanager_config.yaml:
Verification works (no exception)
Doing the same for the notification policy. alertmanager_template.tpl:
Verification fails
Expected behavior
Either the documentation got a faulty example or there's some issue with the verification / linting.
Environment
Mimirtool is running in the latest version. Mimir itself is not involved yet.
Additional Context