mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 04:15:57 +08:00
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:
parent
92ceefccee
commit
ad392e81ff
@ -6,7 +6,7 @@ import { getQueryStats, WsDataEvent } from 'api/common/getQueryStats';
|
|||||||
import logEvent from 'api/common/logEvent';
|
import logEvent from 'api/common/logEvent';
|
||||||
import { getYAxisFormattedValue } from 'components/Graph/yAxisConfig';
|
import { getYAxisFormattedValue } from 'components/Graph/yAxisConfig';
|
||||||
import LogsFormatOptionsMenu from 'components/LogsFormatOptionsMenu/LogsFormatOptionsMenu';
|
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 { DATE_TIME_FORMATS } from 'constants/dateTimeFormats';
|
||||||
import { LOCALSTORAGE } from 'constants/localStorage';
|
import { LOCALSTORAGE } from 'constants/localStorage';
|
||||||
import { AVAILABLE_EXPORT_PANEL_TYPES } from 'constants/panelTypes';
|
import { AVAILABLE_EXPORT_PANEL_TYPES } from 'constants/panelTypes';
|
||||||
@ -247,7 +247,7 @@ function LogsExplorerViews({
|
|||||||
} = useGetExplorerQueryRange(
|
} = useGetExplorerQueryRange(
|
||||||
listChartQuery,
|
listChartQuery,
|
||||||
PANEL_TYPES.TIME_SERIES,
|
PANEL_TYPES.TIME_SERIES,
|
||||||
DEFAULT_ENTITY_VERSION,
|
ENTITY_VERSION_V4,
|
||||||
{
|
{
|
||||||
enabled: !!listChartQuery && panelType === PANEL_TYPES.LIST,
|
enabled: !!listChartQuery && panelType === PANEL_TYPES.LIST,
|
||||||
},
|
},
|
||||||
@ -265,7 +265,7 @@ function LogsExplorerViews({
|
|||||||
} = useGetExplorerQueryRange(
|
} = useGetExplorerQueryRange(
|
||||||
requestData,
|
requestData,
|
||||||
panelType,
|
panelType,
|
||||||
DEFAULT_ENTITY_VERSION,
|
ENTITY_VERSION_V4,
|
||||||
{
|
{
|
||||||
keepPreviousData: true,
|
keepPreviousData: true,
|
||||||
enabled: !isLimit && !!requestData,
|
enabled: !isLimit && !!requestData,
|
||||||
|
@ -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 { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
||||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||||
import { useGetQueryRange } from 'hooks/queryBuilder/useGetQueryRange';
|
import { useGetQueryRange } from 'hooks/queryBuilder/useGetQueryRange';
|
||||||
@ -52,7 +52,7 @@ function TimeSeriesViewContainer({
|
|||||||
dataSource,
|
dataSource,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
DEFAULT_ENTITY_VERSION,
|
ENTITY_VERSION_V4,
|
||||||
{
|
{
|
||||||
queryKey: [
|
queryKey: [
|
||||||
REACT_QUERY_KEY.GET_QUERY_RANGE,
|
REACT_QUERY_KEY.GET_QUERY_RANGE,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import logEvent from 'api/common/logEvent';
|
import logEvent from 'api/common/logEvent';
|
||||||
import { ResizeTable } from 'components/ResizeTable';
|
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 { LOCALSTORAGE } from 'constants/localStorage';
|
||||||
import { QueryParams } from 'constants/query';
|
import { QueryParams } from 'constants/query';
|
||||||
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
||||||
@ -104,7 +104,7 @@ function ListView({ isFilterApplied }: ListViewProps): JSX.Element {
|
|||||||
selectColumns: options?.selectColumns,
|
selectColumns: options?.selectColumns,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
DEFAULT_ENTITY_VERSION,
|
ENTITY_VERSION_V4,
|
||||||
{
|
{
|
||||||
queryKey,
|
queryKey,
|
||||||
enabled:
|
enabled:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Space } from 'antd';
|
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 { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
||||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||||
import { QueryTable } from 'container/QueryTable';
|
import { QueryTable } from 'container/QueryTable';
|
||||||
@ -28,7 +28,7 @@ function TableView(): JSX.Element {
|
|||||||
dataSource: 'traces',
|
dataSource: 'traces',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
DEFAULT_ENTITY_VERSION,
|
ENTITY_VERSION_V4,
|
||||||
{
|
{
|
||||||
queryKey: [
|
queryKey: [
|
||||||
REACT_QUERY_KEY.GET_QUERY_RANGE,
|
REACT_QUERY_KEY.GET_QUERY_RANGE,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Typography } from 'antd';
|
import { Typography } from 'antd';
|
||||||
import logEvent from 'api/common/logEvent';
|
import logEvent from 'api/common/logEvent';
|
||||||
import { ResizeTable } from 'components/ResizeTable';
|
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 { QueryParams } from 'constants/query';
|
||||||
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
||||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||||
@ -52,7 +52,7 @@ function TracesView({ isFilterApplied }: TracesViewProps): JSX.Element {
|
|||||||
pagination: paginationQueryData,
|
pagination: paginationQueryData,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
DEFAULT_ENTITY_VERSION,
|
ENTITY_VERSION_V4,
|
||||||
{
|
{
|
||||||
queryKey: [
|
queryKey: [
|
||||||
REACT_QUERY_KEY.GET_QUERY_RANGE,
|
REACT_QUERY_KEY.GET_QUERY_RANGE,
|
||||||
|
@ -465,7 +465,7 @@ jest.mock('hooks/useHandleExplorerTabChange', () => ({
|
|||||||
describe('TracesExplorer - ', () => {
|
describe('TracesExplorer - ', () => {
|
||||||
it('should render the traces explorer page', async () => {
|
it('should render the traces explorer page', async () => {
|
||||||
server.use(
|
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)),
|
res(ctx.status(200), ctx.json(queryRangeForTimeSeries)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -513,7 +513,7 @@ describe('TracesExplorer - ', () => {
|
|||||||
|
|
||||||
it('trace explorer - list view', async () => {
|
it('trace explorer - list view', async () => {
|
||||||
server.use(
|
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)),
|
res(ctx.status(200), ctx.json(queryRangeForListView)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -536,7 +536,7 @@ describe('TracesExplorer - ', () => {
|
|||||||
|
|
||||||
it('trace explorer - table view', async () => {
|
it('trace explorer - table view', async () => {
|
||||||
server.use(
|
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)),
|
res(ctx.status(200), ctx.json(queryRangeForTableView)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -554,7 +554,7 @@ describe('TracesExplorer - ', () => {
|
|||||||
|
|
||||||
it('trace explorer - trace view', async () => {
|
it('trace explorer - trace view', async () => {
|
||||||
server.use(
|
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)),
|
res(ctx.status(200), ctx.json(queryRangeForTraceView)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user