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

Add support for health diagnostic errors backwards compatibility #38

Closed
vickyyyyyyy opened this issue Apr 30, 2021 · 0 comments
Closed
Assignees

Comments

@vickyyyyyyy
Copy link
Member

Context

With the new health diagnostics work, we have introduced a new error format for better user feedback:

Previous error message:

Screenshot 2021-04-30 at 11.45.20.png

New error message:

Screenshot 2021-04-30 at 11.45.11.png

What the problem is

The changes in core Grafana to allow the new format will be released in Grafana 8.
However, the new changes are not backwards compatible, due to the way we are structuring the backend response.

For the backend, we are now moving the old error message from CheckHealthResult.Message to CheckHealthResult.JSONDetails.verboseMessage which means for the frontend, we will need to move the old error message from testingStatus.message to testingStatus.details.verboseMessage.

Pre v8 expected backend response:

&backend.CheckHealthResult{
   Status:   backend.HealthStatusError,
   Message:  "Get \"http://asddasda/controller/rest/applications?output=json\": dial tcp: lookup asddasda on 194.168.4.100:53: no such host",
}

Post v8 expected backend response:

&backend.CheckHealthResult{
   Status:       backend.HealthStatusError,
   Message:      "Bad request (400)",
   JSONDetails:  []byte(`{
      "message":"Could not connect to AppDynamics. This usually happens when the URL is incorrect.",
      "verboseMessage":"Get "http://asddasda/controller/rest/applications?output=json": dial tcp: lookup asddasda on 194.168.4.100:53: no such host",
   }`),
}

Pre v8 expected Alert:

<Alert
   severity={testingStatus.status === 'error' ? 'error' : 'success'}
   title={testingStatus.message}
   aria-label={selectors.pages.DataSource.alert}
>
   {testingStatus.details?.message ?? null}
   {testingStatus.details?.verboseMessage ? (
      <details style={{ whiteSpace: 'pre-wrap' }}>{testingStatus.details?.verboseMessage}</details>
   ) : null}
</Alert>

Post v8 expected Alert:

<Alert
   severity={testingStatus.status === 'error' ? 'error' : 'success'}
   title={testingStatus.message}
   aria-label={selectors.pages.DataSource.alert}
/>

We need to find a way to support users running Grafana <8 because they would end up seeing:

Screenshot 2021-04-30 at 11.53.40.png

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

No branches or pull requests

1 participant