Prometheus: Update healthcheck text message (#67401)

* the healthcheck is used outside the config save&test so change text message

* fix e2e test
This commit is contained in:
Brendan O'Handley 2023-04-27 15:54:12 -04:00 committed by GitHub
parent dac709b347
commit f70efed2cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@ const dataSourceName = 'PromExemplar';
const addDataSource = () => {
e2e.flows.addDataSource({
type: 'Prometheus',
expectedAlertMessage: 'saved',
expectedAlertMessage: 'Prometheus',
name: dataSourceName,
form: () => {
e2e.components.DataSource.Prometheus.configPage.exemplarsAddButton().click();

View File

@ -64,15 +64,15 @@ func healthcheck(ctx context.Context, req *backend.CheckHealthRequest, i *instan
})
if err != nil {
return getHealthCheckMessage(logger, "Your configuration has been saved but there is an error.", err)
return getHealthCheckMessage(logger, "There was an error returned querying the Prometheus API.", err)
}
if resp.Responses[refID].Error != nil {
return getHealthCheckMessage(logger, "Your configuration has been saved but there is an error.",
return getHealthCheckMessage(logger, "There was an error returned querying the Prometheus API.",
errors.New(resp.Responses[refID].Error.Error()))
}
return getHealthCheckMessage(logger, "Successfully saved the configuration and queried the Prometheus API.", nil)
return getHealthCheckMessage(logger, "Successfully queried the Prometheus API.", nil)
}
func getHealthCheckMessage(logger log.Logger, message string, err error) (*backend.CheckHealthResult, error) {