Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Modifications for supporting migration of notification channels #19

Merged
merged 2 commits into from
Mar 1, 2021

Conversation

papagian
Copy link
Collaborator

  • It adds default_receiver
  • Is adds support for associating notification channels with rules (used for the migration)

@@ -304,5 +304,7 @@ func (r *ApiReceiver) Type() ReceiverType {
}

type GrafanaReceivers struct {
// required: true
DefaultReceiver *GrafanaReceiver `yaml:"default_receiver" json:"default_receiver"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is default receiver config on a receiver for?

Copy link
Member

Choose a reason for hiding this comment

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

Now that we support routing config, I think that can take care of the default config?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have added it based on this but I may have misinterpreted.

Copy link
Collaborator

Choose a reason for hiding this comment

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

as @codesome says, not needed now that we know that routing will be supported. Can configure a receiver on the root route for same effect

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks for clarifying it; I will remove it.

@@ -157,6 +157,8 @@ type ExtendedUpsertAlertDefinitionCommand struct {
NoDataState NoDataState `json:"no_data_state" yaml:"no_data_state"`
ExecutionErrorState ExecutionErrorState `json:"exec_err_state" yaml:"exec_err_state"`
Settings map[string]interface{} `json:"settings" yaml:"settings"`
// Receivers are optional and used for migrating notification channels of existing alerts
Receivers []*GrafanaReceiver `json:"receivers" yaml:"receivers"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be a list of strings (receiver names), not full receiver configs

Copy link
Member

Choose a reason for hiding this comment

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

+1, I was expecting it to be a list of strings and the backend will do the matching

Copy link
Member

Choose a reason for hiding this comment

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

Agree as well. I think these should already be defined in the config object and possibly just referenced here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I expected this :)
I will change it to a list of strings.

@papagian
Copy link
Collaborator Author

papagian commented Mar 1, 2021

@codesome @domasx2
I made the modifications. Can you check them? thanks!

Copy link
Member

@owen-d owen-d left a comment

Choose a reason for hiding this comment

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

Oops, never submitted this review earlier 😱

@@ -157,6 +157,8 @@ type ExtendedUpsertAlertDefinitionCommand struct {
NoDataState NoDataState `json:"no_data_state" yaml:"no_data_state"`
ExecutionErrorState ExecutionErrorState `json:"exec_err_state" yaml:"exec_err_state"`
Settings map[string]interface{} `json:"settings" yaml:"settings"`
// Receivers are optional and used for migrating notification channels of existing alerts
Receivers []*GrafanaReceiver `json:"receivers" yaml:"receivers"`
Copy link
Member

Choose a reason for hiding this comment

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

Agree as well. I think these should already be defined in the config object and possibly just referenced here.

@owen-d owen-d merged commit b80b89e into master Mar 1, 2021
@owen-d owen-d deleted the grafana_managed_receiver_configs branch March 4, 2021 12:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants