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

Alertmanager: Load additional templates for Grafana receivers #8440

Closed
1 task done
stevesg opened this issue Jun 20, 2024 · 0 comments
Closed
1 task done

Alertmanager: Load additional templates for Grafana receivers #8440

stevesg opened this issue Jun 20, 2024 · 0 comments

Comments

@stevesg
Copy link
Contributor

stevesg commented Jun 20, 2024

Grafana uses a slightly different set of default templates, so we need to load those for some of receivers to work.

ts=2024-06-20T09:01:38.840935785Z caller=log.go:44 level=warn component=MultiTenantAlertmanager user=702 logger=ngalert.notifier.webhook notifierUID=db8e8538-3b70-4444-a830-14ad4d2e4cd6 msg="failed to template webhook message" error="template: :1:12: executing \"\" at <{{template \"default.title\" .}}>: template \"default.title\" not defined"

I think it would be safest initially to only load these if we've decided to use the Grafana configuration. If we're not using it, then don't. In the future when configurations are merged, we can decide how to handle this.

@santihernandezc has already implemented this in his POC branch - code for reference:

if err := tmpl.Parse(strings.NewReader(alertingTemplates.DefaultTemplateString)); err != nil {
	return err
}

Tasks

  1. component/alertmanager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants