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

Check upon config load whether alerting rule template fields can be parsed #835

Closed
juliusv opened this Issue Jun 23, 2015 · 3 comments

Comments

Projects
None yet
5 participants
@juliusv
Copy link
Member

juliusv commented Jun 23, 2015

A user got error parsing template __alert_GlimpseDNSHighLatency: template: __alert_GlimpseDNSHighLatency:1: unexpected "*" in operand; missing space? in the Alertmanager email message because they had {{$labels.quantile * 100}} in their alerting message template, which isn't valid in Go templates. Can we detect this sort of thing at configuration load time by test-parsing the SUMMARY and DESCRIPTION fields?

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jun 24, 2015

We can add a parse+execute cycle to the promtool. Parsing alone doesn't guarantee that much for templates.
I'll look into that later today.

@codesome

This comment has been minimized.

Copy link
Member

codesome commented Aug 26, 2018

I have done some similar checks in #4277. Only catch is that it wont detect $labels.something_wrong, but would detect $something_wrong, and the one mentioned in the issue description.

I will open a PR for this.

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 22, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.