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

Move VictorOps from Grafana repository #25

Merged
merged 34 commits into from
Dec 19, 2022
Merged

Move VictorOps from Grafana repository #25

merged 34 commits into from
Dec 19, 2022

Conversation

yuri-tceretian
Copy link
Contributor

@yuri-tceretian yuri-tceretian commented Dec 19, 2022

This PR moves receiver VictorOPS from Grafan to alerting repository keeping a history of all changes in the files.

NOTE:

  1. I dropped commit grafana/grafana@f0cabe1 because it updates the files to refer to the imported package.

  2. This notifier uses the Grafana build version in the request sent to API. The build version was taken from a package variable in the settings that is not available anymore. I replaced it with a new field of FactoryConfig.

  3. Starting with commit 09b5a5a are changes that I added to this code.

codesome and others added 30 commits December 19, 2022 15:41
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
* Alerting: Opsgenie notification channel

This translate the opsgenie notification channel from the old alerting
system to the new alerting system with a few changes:

- The tag system has been replaced in favour of annotation.
- TBD
- TBD

Signed-off-by: Josue Abreu <josue@grafana.com>

* Fix template URL

* Bugfig: dont send resolved when autoClose is false

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Fix integration tests

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Fix URLs in all other channels

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
* NGAlert: Update the default template to include more URLs

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Fix tests

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
* Alerting: Do not hard fail on templating errors in channels

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Fix review

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
…35749)

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
* Alerting: Improve receiver initialisation errors
…ified Alerting (#40717)

* Alerting: Validate contact point configuration during the migration

This minimises the chances of generating broken configuration as part of the migration. Originally, we wanted to generate it and not produce a hard stop in Grafana but this strategy has the chance to avoid delivering notifications for our users.

We now think it's better to hard stop the migration and let the user take care of resolving the configuration manually.
* add value to email template

* add value to default template

* update test string

* test: fix ngalert test suite

* test: run CI

Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
* Allow customizable googlechat message via optional setting

* Add optional message field in googlechat contact point configurator

* Fix strange error message on send if template fails to fully evaluate

* Elevate template evaluation failure logs to Warn level

* Extract default.title template embed from all channels to shared constant
* pass notification service down to the notifiers

* add ns to all notifiers

* remove bus from ngalert notifiers

* use smaller interfaces for notificationservice

* attempt to fix the tests

* remove unused struct field

* simplify notification service mock

* trying to resolve issues in the tests

* make linter happy

* make linter even happier

* linter, you are annoying
* Update silence url generation

* Update tests

* Update test to the new silence params format

* Fix tests
* fix empty URLs

* leave URL templating, use fallback

* better fix, new tests cases

* fix linting errors
… "err" (#50333)

* Alerting: decapitalize log lines and use "err" as the key for errors

Found using (logger|log).(Warn|Debug|Info|Error)\([A-Z] and (logger|log).(Warn|Debug|Info|Error)\(.+"error"
* Resolve conflicts

* Combine multiple const definitions
…ding/json to parse settings instead of simplejson (#55779)

* update victorops
* update threema
* update telegram
* Add title and description to VictorOps contact point

* Update pkg/services/ngalert/notifier/channels_config/available_channels.go

Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>

Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
…manager (#59339)

* Move truncation code to util to mirror upstream

* Resolve merge conflicts

* Align logging of alert key

* Update tests and fix field passing bug

* Remove superfluous newline in test now that we trim whitespace

* Uptake minor log changes from upstream
…ing notifiers (#60271)

* create sender service interface and bridge to grafana notifier service
* update notifiers to use local sender interface
…ge (#60358)

* remove intermediate struct to create Base struct
* fix alertmanager
… (#60361)

* introduce Logger interface local to channles + implementaton that wraps the Grafana logger
* make NewFactoryConfig accept LoggerFactory
* add logger field to FactoryConfig
* update usages of log.Logger to internal interface
…ionChannelConfig (#60423)

* introduce alias for json.RawMessage with name RawMessage. This is needed to keep raw JSON and implement a marshaler for YAML, which does not seem to be used but there are tests that fail.
* replace usage of simplejson with RawMessage in NotificationChannelConfig
* remove usage of simplejson in tests
* change migration code to convert simplejson to raw message
@CLAassistant
Copy link

CLAassistant commented Dec 19, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
11 out of 13 committers have signed the CLA.

✅ codesome
✅ peterholmberg
✅ gotjosh
✅ papagian
✅ gillesdemey
✅ alexweav
✅ zserge
✅ grobinson-grafana
✅ santihernandezc
✅ yuri-tceretian
✅ JohnnyQQQQ
❌ idafurjes
❌ konrad147
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@alexmobo alexmobo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet