Skip to content
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

mimirtool alertmanager verify: found character that cannot start any token #9409

Open
toby181 opened this issue Sep 25, 2024 · 0 comments
Open
Labels
bug Something isn't working component/mimirtool type/docs Improvements or additions to documentation

Comments

@toby181
Copy link

toby181 commented Sep 25, 2024

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:

route:
  receiver: "example_receiver"
  group_by: ["example_groupby"]
receivers:
  - name: "example_receiver"

Verification works (no exception)

$ mimirtool alertmanager verify alertmanager_config.yaml --log.level="debug"
INFO[0000] log level set to debug                       

Doing the same for the notification policy.
alertmanager_template.tpl:

{{ define "alert_customer_env_message" }}
  [{{ .CommonLabels.alertname }} | {{ .CommonLabels.customer }} | {{ .CommonLabels.environment }}]
{{ end }}

Verification fails

$ mimirtool alertmanager verify alertmanager_template.tpl --log.level="debug"
INFO[0000] log level set to debug                       
mimirtool: error: yaml: line 2: found character that cannot start any token, try --help

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.

mimirtool version  
Mimirtool, version 2.13.0 (branch: HEAD, revision: 4775ec156)
  go version:       go1.22.5
  platform:         darwin/arm64
checking latest version... You are on the latest version

Additional Context

@56quarters 56quarters added bug Something isn't working type/docs Improvements or additions to documentation component/mimirtool labels Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component/mimirtool type/docs Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants