K-Phoen / grabana

User-friendly Go library for building Grafana dashboards
MIT License
680 stars 69 forks source link

Introduce support to override alert rule name #234

Open themarcelor opened 1 year ago

themarcelor commented 1 year ago

Currently, the alert rule is provisioned with a Title that matches the panel title. The Alert constructor function receives a name argument but misleadingly sets that value as the alert rule's Summary instead of AlertRule.Title.

The provisioned dashboard panels can have generic names like "traffic" or "latency", but their corresponding Alert Rules need to have more specific titles, e.g.:

Hence, this PR will allow the operator to utilize an alert.name() option.

codecov[bot] commented 1 year ago

Codecov Report

Merging #234 (bb84610) into master (6867a4a) will decrease coverage by 0.06%. Report is 1 commits behind head on master. The diff coverage is 0.00%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/K-Phoen/grabana/pull/234/graphs/tree.svg?width=650&height=150&src=pr&token=eJwYXNp5jD&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=K%C3%A9vin+Gomez)](https://app.codecov.io/gh/K-Phoen/grabana/pull/234?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=K%C3%A9vin+Gomez) ```diff @@ Coverage Diff @@ ## master #234 +/- ## ========================================== - Coverage 90.08% 90.03% -0.06% ========================================== Files 92 92 Lines 6941 6945 +4 ========================================== Hits 6253 6253 - Misses 543 547 +4 Partials 145 145 ``` | [Files Changed](https://app.codecov.io/gh/K-Phoen/grabana/pull/234?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=K%C3%A9vin+Gomez) | Coverage Δ | | |---|---|---| | [alert/alert.go](https://app.codecov.io/gh/K-Phoen/grabana/pull/234?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=K%C3%A9vin+Gomez#diff-YWxlcnQvYWxlcnQuZ28=) | `96.39% <0.00%> (-3.61%)` | :arrow_down: |

:loudspeaker: Have feedback on the report? Share it here.