Skip to content

Commit

Permalink
feat: description by template (moira-alert#49)
Browse files Browse the repository at this point in the history
Co-authored-by: Nikolay <[email protected]>
  • Loading branch information
Nixolay and Nikolay authored Apr 17, 2020
1 parent 939e6a2 commit 0f18526
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions source/user_guide/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,29 @@ You can use any govaluate_ expression with predefined constants here:

Any incorrect expressions or bad syntax will result in EXCEPTION trigger state.


Templates
-------------

The template is supported by Moira, the template implements data-driven templates for generating textual output.
Information about how to program the templates themselves, see the `documentation. <https://golang.org/pkg/html/template/>`_

Data you can use:

| Trigger { Name }
| Events [ ] {
| Metric
| MetricElements [ ]string
| Timestamp
| Value
| State
| }
Example:

``https://grafana.yourhost.com/some-dashboard{{ range $i, $v := .Events }}{{ if ne $i 0 }}&{{ else }}?{{ end }}var-host={{ $v.Metric }}{{ end }}``


Data source
------------

Expand Down

0 comments on commit 0f18526

Please sign in to comment.