mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-17 15:36:48 +00:00
feat: fixed reduceTo not working
This commit is contained in:
parent
3a623fef8f
commit
6ed78e8a4d
@ -163,6 +163,7 @@ export function parseAggregations(
|
||||
|
||||
export function createAggregation(
|
||||
queryData: any,
|
||||
panelType?: PANEL_TYPES,
|
||||
): TraceAggregation[] | LogAggregation[] | MetricAggregation[] {
|
||||
if (!queryData) {
|
||||
return [];
|
||||
@ -170,9 +171,10 @@ export function createAggregation(
|
||||
|
||||
const haveReduceTo =
|
||||
queryData.dataSource === DataSource.METRICS &&
|
||||
(queryData.panelType === PANEL_TYPES.TABLE ||
|
||||
queryData.panelType === PANEL_TYPES.PIE ||
|
||||
queryData.panelType === PANEL_TYPES.VALUE);
|
||||
panelType &&
|
||||
(panelType === PANEL_TYPES.TABLE ||
|
||||
panelType === PANEL_TYPES.PIE ||
|
||||
panelType === PANEL_TYPES.VALUE);
|
||||
|
||||
if (queryData.dataSource === DataSource.METRICS) {
|
||||
return [
|
||||
@ -219,7 +221,7 @@ function convertBuilderQueriesToV5(
|
||||
const baseSpec = createBaseSpec(queryData, requestType, panelType);
|
||||
let spec: QueryEnvelope['spec'];
|
||||
|
||||
const aggregations = createAggregation(queryData);
|
||||
const aggregations = createAggregation(queryData, panelType);
|
||||
|
||||
switch (signal) {
|
||||
case 'traces':
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
/* eslint-disable sonarjs/cognitive-complexity */
|
||||
import { ColumnsType, ColumnType } from 'antd/es/table';
|
||||
import { createAggregation } from 'api/v5/queryRange/prepareQueryRangePayloadV5';
|
||||
import { PANEL_TYPES } from 'constants/queryBuilder';
|
||||
import { convertUnit } from 'container/NewWidget/RightContainer/dataFormatCategories';
|
||||
import { ThresholdProps } from 'container/NewWidget/RightContainer/Threshold/types';
|
||||
import { QUERY_TABLE_CONFIG } from 'container/QueryTable/config';
|
||||
@ -191,6 +192,7 @@ export function createColumnsAndDataSource(
|
||||
(query) => query.queryName === item.queryName,
|
||||
)
|
||||
: undefined,
|
||||
PANEL_TYPES.TABLE,
|
||||
)?.length > 1;
|
||||
|
||||
const column: ColumnType<RowData> = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user