From 5a905e2e941acaff4e89ecca2d4b36041d0de8bb Mon Sep 17 00:00:00 2001 From: Yury Molodov Date: Thu, 19 Sep 2024 14:30:54 +0200 Subject: [PATCH] vmui: change the `query_range` request method from `GET` to `POST` (#7039) ### Describe Your Changes change the `/query_range` and `/query` requests method from `GET` to `POST`. See #6288. ### Checklist The following checks are **mandatory**: - [x] My change adheres [VictoriaMetrics contributing guidelines](https://docs.victoriametrics.com/contributing/). --------- Signed-off-by: hagen1778 Co-authored-by: hagen1778 (cherry picked from commit b0bdb927298846b04c67c80f5d2bf096a26f86bc) --- app/vmui/packages/vmui/src/hooks/useFetchQuery.ts | 7 ++++++- docs/changelog/CHANGELOG.md | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/vmui/packages/vmui/src/hooks/useFetchQuery.ts b/app/vmui/packages/vmui/src/hooks/useFetchQuery.ts index 9e3516026e..7aba2dc0a8 100644 --- a/app/vmui/packages/vmui/src/hooks/useFetchQuery.ts +++ b/app/vmui/packages/vmui/src/hooks/useFetchQuery.ts @@ -110,7 +110,12 @@ export const useFetchQuery = ({ continue; } - const response = await fetch(url, { signal: controller.signal }); + const urlObj = new URL(url); + const response = await fetch(`${urlObj.origin}${urlObj.pathname}`, { + signal: controller.signal, + method: "POST", + body: urlObj.searchParams + }); const resp = await response.json(); if (response.ok) { diff --git a/docs/changelog/CHANGELOG.md b/docs/changelog/CHANGELOG.md index e9f5f4e223..5aebbcd5c1 100644 --- a/docs/changelog/CHANGELOG.md +++ b/docs/changelog/CHANGELOG.md @@ -30,6 +30,7 @@ See also [LTS releases](https://docs.victoriametrics.com/lts-releases/). * FEATURE: [vmgateway](https://docs.victoriametrics.com/vmgateway/): allow disabling `Bearer` prefix enforcement for authentication header. This is useful for cases when identity token is used instead of access token. * FEATURE: [vmgateway](https://docs.victoriametrics.com/vmgateway/): support parting `vm_access` claims in string format. This is useful for cases when identity provider does not support mapping claims to JSON format. * FEATURE: [Single-node VictoriaMetrics](https://docs.victoriametrics.com/) and `vmstorage` in [VictoriaMetrics cluster](https://docs.victoriametrics.com/cluster-victoriametrics/): Adds new metrics for data ingestion: `vm_rows_received_by_storage_total`, `vm_rows_ignored_total{reason="nan_value"}`, `vm_rows_ignored_total{reason="invalid_raw_metric_name"}`, `vm_rows_ignored_total{reason="hourly_limit_exceeded"}`, `vm_rows_ignored_total{reason="daily_limit_exceeded"}`. See this [PR](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6663) for details. +* FEATURE: [vmui](https://docs.victoriametrics.com/#vmui): change the request method for `/query_range` and `/query` from `GET` to `POST`. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6288). * BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent/) fix service discovery of Azure Virtual Machines for response contains `nextLink` in `Host:Port` format. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6912). * BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent/): properly consume messages [from kafka](https://docs.victoriametrics.com/vmagent/#kafka-integration). Previously vmagent could skip some messages during start-up.