Fix: Update query_range api from v3 to v4 (Logs and Traces) (#7906)

* fix: change query range api from v3 to v4

* test: update test cases

---------

Co-authored-by: Aditya Singh <adityasingh@Adityas-MacBook-Pro.local>
This commit is contained in:
Aditya Singh 2025-05-13 15:24:37 +05:30 committed by GitHub
parent 92ceefccee
commit ad392e81ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 15 additions and 15 deletions

View File

@ -6,7 +6,7 @@ import { getQueryStats, WsDataEvent } from 'api/common/getQueryStats';
import logEvent from 'api/common/logEvent';
import { getYAxisFormattedValue } from 'components/Graph/yAxisConfig';
import LogsFormatOptionsMenu from 'components/LogsFormatOptionsMenu/LogsFormatOptionsMenu';
import { DEFAULT_ENTITY_VERSION } from 'constants/app';
import { ENTITY_VERSION_V4 } from 'constants/app';
import { DATE_TIME_FORMATS } from 'constants/dateTimeFormats';
import { LOCALSTORAGE } from 'constants/localStorage';
import { AVAILABLE_EXPORT_PANEL_TYPES } from 'constants/panelTypes';
@ -247,7 +247,7 @@ function LogsExplorerViews({
} = useGetExplorerQueryRange(
listChartQuery,
PANEL_TYPES.TIME_SERIES,
DEFAULT_ENTITY_VERSION,
ENTITY_VERSION_V4,
{
enabled: !!listChartQuery && panelType === PANEL_TYPES.LIST,
},
@ -265,7 +265,7 @@ function LogsExplorerViews({
} = useGetExplorerQueryRange(
requestData,
panelType,
DEFAULT_ENTITY_VERSION,
ENTITY_VERSION_V4,
{
keepPreviousData: true,
enabled: !isLimit && !!requestData,

View File

@ -1,4 +1,4 @@
import { DEFAULT_ENTITY_VERSION } from 'constants/app';
import { ENTITY_VERSION_V4 } from 'constants/app';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import { useGetQueryRange } from 'hooks/queryBuilder/useGetQueryRange';
@ -52,7 +52,7 @@ function TimeSeriesViewContainer({
dataSource,
},
},
DEFAULT_ENTITY_VERSION,
ENTITY_VERSION_V4,
{
queryKey: [
REACT_QUERY_KEY.GET_QUERY_RANGE,

View File

@ -1,6 +1,6 @@
import logEvent from 'api/common/logEvent';
import { ResizeTable } from 'components/ResizeTable';
import { DEFAULT_ENTITY_VERSION } from 'constants/app';
import { ENTITY_VERSION_V4 } from 'constants/app';
import { LOCALSTORAGE } from 'constants/localStorage';
import { QueryParams } from 'constants/query';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
@ -104,7 +104,7 @@ function ListView({ isFilterApplied }: ListViewProps): JSX.Element {
selectColumns: options?.selectColumns,
},
},
DEFAULT_ENTITY_VERSION,
ENTITY_VERSION_V4,
{
queryKey,
enabled:

View File

@ -1,5 +1,5 @@
import { Space } from 'antd';
import { DEFAULT_ENTITY_VERSION } from 'constants/app';
import { ENTITY_VERSION_V4 } from 'constants/app';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import { QueryTable } from 'container/QueryTable';
@ -28,7 +28,7 @@ function TableView(): JSX.Element {
dataSource: 'traces',
},
},
DEFAULT_ENTITY_VERSION,
ENTITY_VERSION_V4,
{
queryKey: [
REACT_QUERY_KEY.GET_QUERY_RANGE,

View File

@ -1,7 +1,7 @@
import { Typography } from 'antd';
import logEvent from 'api/common/logEvent';
import { ResizeTable } from 'components/ResizeTable';
import { DEFAULT_ENTITY_VERSION } from 'constants/app';
import { ENTITY_VERSION_V4 } from 'constants/app';
import { QueryParams } from 'constants/query';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
@ -52,7 +52,7 @@ function TracesView({ isFilterApplied }: TracesViewProps): JSX.Element {
pagination: paginationQueryData,
},
},
DEFAULT_ENTITY_VERSION,
ENTITY_VERSION_V4,
{
queryKey: [
REACT_QUERY_KEY.GET_QUERY_RANGE,

View File

@ -465,7 +465,7 @@ jest.mock('hooks/useHandleExplorerTabChange', () => ({
describe('TracesExplorer - ', () => {
it('should render the traces explorer page', async () => {
server.use(
rest.post('http://localhost/api/v3/query_range', (req, res, ctx) =>
rest.post('http://localhost/api/v4/query_range', (req, res, ctx) =>
res(ctx.status(200), ctx.json(queryRangeForTimeSeries)),
),
);
@ -513,7 +513,7 @@ describe('TracesExplorer - ', () => {
it('trace explorer - list view', async () => {
server.use(
rest.post('http://localhost/api/v3/query_range', (req, res, ctx) =>
rest.post('http://localhost/api/v4/query_range', (req, res, ctx) =>
res(ctx.status(200), ctx.json(queryRangeForListView)),
),
);
@ -536,7 +536,7 @@ describe('TracesExplorer - ', () => {
it('trace explorer - table view', async () => {
server.use(
rest.post('http://localhost/api/v3/query_range', (req, res, ctx) =>
rest.post('http://localhost/api/v4/query_range', (req, res, ctx) =>
res(ctx.status(200), ctx.json(queryRangeForTableView)),
),
);
@ -554,7 +554,7 @@ describe('TracesExplorer - ', () => {
it('trace explorer - trace view', async () => {
server.use(
rest.post('http://localhost/api/v3/query_range', (req, res, ctx) =>
rest.post('http://localhost/api/v4/query_range', (req, res, ctx) =>
res(ctx.status(200), ctx.json(queryRangeForTraceView)),
),
);