-
Notifications
You must be signed in to change notification settings - Fork 537
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
Alertmanager: Add Grafana's external URL #8498
Alertmanager: Add Grafana's external URL #8498
Conversation
@@ -290,6 +291,8 @@ func (am *MultitenantAlertmanager) GetUserGrafanaConfig(w http.ResponseWriter, r | |||
Hash: cfg.Hash, | |||
CreatedAt: cfg.CreatedAtTimestamp, | |||
Default: cfg.Default, | |||
Promoted: cfg.Promoted, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick fix, we forgot to add this field in the response to GET api/v1/grafana/config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm finding this a little confusing. I'm not too keen on:
a) passing this extra string around as a parameter on the end of all these functions
b) the fact we pass the Mimir ExternalURL in completely different way
I think a nicer approach would be:
computeConfig
determines the ExternalURL based on what configuration is in use- If the Mimir configuration is in use, pass the ExternalURL configured on the command line
- If the Grafana configuration is in use, pass the ExternalURL from the configuration
- That is then to
ApplyConfig
, which uses it to create the template
I'd rather see it passed around in a struct of some type, perhaps bundling a alertspb.AlertConfigDesc
and the ExternalURL string together.
@@ -99,6 +99,7 @@ type Config struct { | |||
PersisterConfig PersisterConfig | |||
|
|||
GrafanaAlertmanagerCompatibility bool | |||
GrafanaExternalURL string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to store it - it will only get used in ApplyConfig
.
Closing in favor of #8465 |
This PR adds the Grafana external URL to an Alertmanager at creation time. This URL is sent from Grafana and will be used when templating notifications.
Related PoC: #8376