Skip to content

Commit

Permalink
vmui: remove redundant requests on the Explore Cardinality page #6240
Browse files Browse the repository at this point in the history
  • Loading branch information
Loori-R authored and hagen1778 committed May 14, 2024
1 parent 6a6e34a commit 1d42287
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,23 @@ export const useFetchQuery = (): {

const prevDayParams = {
...requestParams,
date: dayjs(requestParams.date).subtract(1, "day").tz().format(DATE_FORMAT),
date: dayjs(requestParams.date).subtract(1, "day").format(DATE_FORMAT),
};

const urls = [
getCardinalityInfo(serverUrl, requestParams),
getCardinalityInfo(serverUrl, prevDayParams),
];

if (prevDate !== date) {
if (prevDate !== date && totalParams.match || totalParams.focusLabel) {
urls.push(getCardinalityInfo(serverUrl, totalParams));
}

try {
const [resp, respPrev, respTotals = {}] = await Promise.all(urls.map(getResponseJson));
const [resp, respPrev, respTotals] = await Promise.all(urls.map(getResponseJson));

const prevResult = { ...respPrev.data };
const { data: dataTotal } = respTotals;
const { data: dataTotal } = respTotals || resp;
const result: TSDBStatus = {
...resp.data,
totalSeries: resp.data?.totalSeries || resp.data?.headStats?.numSeries || 0,
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ See also [LTS releases](https://docs.victoriametrics.com/lts-releases/).
* FEATURE: [stream aggregation](https://docs.victoriametrics.com/stream-aggregation/): add [rate_sum](https://docs.victoriametrics.com/stream-aggregation/#rate_sum) and [rate_avg](https://docs.victoriametrics.com/stream-aggregation/#rate_avg) aggregation outputs.

* BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): fix bug that prevents the first query trace from expanding on click event. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6186). The issue was introduced in [v1.100.0](https://docs.victoriametrics.com/changelog/#v11000) release.
* BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): remove redundant requests on the `Explore Cardinality` page. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6240).
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent/): prevent potential panic during [stream aggregation](https://docs.victoriametrics.com/stream-aggregation.html) if more than one `--remoteWrite.streamAggr.dedupInterval` is configured. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6205).
* BUGFIX: [stream aggregation](https://docs.victoriametrics.com/stream-aggregation/): set correct suffix `<output>_prometheus` for aggregation outputs [increase_prometheus](https://docs.victoriametrics.com/stream-aggregation/#increase_prometheus) and [total_prometheus](https://docs.victoriametrics.com/stream-aggregation/#total_prometheus). Before, outputs `total` and `total_prometheus` or `increase` and `increase_prometheus` had the same suffix.
* BUGFIX: properly estimate the needed memory for query execution if it has the format [`aggr_func`](https://docs.victoriametrics.com/metricsql/#aggregate-functions)([`rollup_func[d]`](https://docs.victoriametrics.com/metricsql/#rollup-functions) (for example, `sum(rate(request_duration_seconds_bucket[5m]))`). This should allow performing aggregations over bigger number of time series when VictoriaMetrics runs in environments with small amounts of available memory. The issue has been introduced in [this commit](https://github.com/VictoriaMetrics/VictoriaMetrics/commit/5138eaeea0791caa34bcfab410e0ca9cd253cd8f) in [v1.83.0](https://docs.victoriametrics.com/changelog_2022/#v1830).
Expand Down

0 comments on commit 1d42287

Please sign in to comment.