vmui: improve error message for server response issues (#6177)

Updates error messages for better clarity and guidance on server
response issues.

(cherry picked from commit 57b7d16259)
This commit is contained in:
Yury Molodov 2024-04-25 12:52:13 +02:00 committed by hagen1778
parent 669cbcb92e
commit 14c0c06526
No known key found for this signature in database
GPG key ID: 3BF75F3741CA9640
2 changed files with 11 additions and 2 deletions

View file

@ -153,9 +153,17 @@ export const useFetchQuery = ({
setTraces(tempTraces);
setIsHistogram(prev => totalLength ? isHistogramResult : prev);
} catch (e) {
if (e instanceof Error && e.name !== "AbortError") {
setError(`${e.name}: ${e.message}`);
const error = e as Error;
if (error.name === "AbortError") {
// Aborts are expected, don't show an error for them.
return;
}
const helperText = "Please check your serverURL settings and confirm server availability.";
let text = `Error executing query: ${error.message}. ${helperText}`;
if (error.message === "Unexpected end of JSON input") {
text += "\nAdditionally, this error can occur if the server response is too large to process. Apply more specific filters to reduce the data volume.";
}
setError(text);
}
setIsLoading(false);
};

View file

@ -42,6 +42,7 @@ See also [LTS releases](https://docs.victoriametrics.com/lts-releases/).
* FEATURE: [vmui](https://docs.victoriametrics.com/#vmui): optimize auto-suggestion performance for metric names when the database contains big number of unique time series.
* FEATURE: [vmui](https://docs.victoriametrics.com/#vmui): in the Select component, user-entered values are now preserved on blur if they match options in the list.
* FEATURE: [vmui](https://docs.victoriametrics.com/#vmui): auto-suggestion triggers at any cursor position in the query input. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5864).
* FEATURE: [vmui](https://docs.victoriametrics.com/#vmui): update error messages on the Query page for enhanced clarity. See [this pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6177).
* BUGFIX: [downsampling](https://docs.victoriametrics.com/#downsampling): skip unnecessary index lookups if downsampling wasn't set for ENT versions of VictoriaMetrics. Before, users of VictoriaMetrics ENT could have experience elevated CPU usage even if no downsampling was configured. The issue was introduced in [v1.100.0](https://docs.victoriametrics.com/changelog/#v11000).
* BUGFIX: [downsampling](https://docs.victoriametrics.com/#downsampling): properly populate downsampling metadata for data parts created by VictoriaMetrics ENT versions lower than v1.100.0. The bug could trigger the downsampling actions for parts that were downsampled already. This bug doesn't have any negative effect apart from spending extra CPU resources on the repeated downsampling. The issue was introduced in [v1.100.0](https://docs.victoriametrics.com/changelog/#v11000).