cortex-tools icon indicating copy to clipboard operation
cortex-tools copied to clipboard

Improve cortextool documentation to cover Alertmanager templates

Open ethirolle opened this issue 3 years ago • 0 comments

The cortextool doc (at https://github.com/grafana/cortex-tools/blob/main/README.md) does not dicuss how to interact with alert template files (i.e., these templates: https://prometheus.io/docs/alerting/latest/notification_examples/#defining-reusable-templates).

Here is the advice that I provided to a customer, and which allowed them to resolve their issue:

The solution for the customer was these two changes:

  • cd into the folder that contains both the YAML and template file(s), so that cortextool can refer to bare filenames (no paths to the files), like cortextool alertmanager load alertmanager.yml pagerduty.tmpl

In the Altertmanager YAML file, reference to the template file(s) like this:

templates:
  - pagerduty.tmpl

After doing this, the files upload without error, and cortextool alertmanager get shows the YAML and the template file(s).

Note: with this syntax, I believe you can define and send multiple template files, like:

cortextool alertmanager load alertmanager.yml one.tmpl two.tmpl three.tmpl

Can we add some of this advice in the cortextool ReadMe? Thanks!!

ethirolle avatar Jun 21 '21 18:06 ethirolle