mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 15:59:01 +08:00
Revert "fix: added default value to time,space aggregation to fix query_range…" (#7464)
This reverts commit 8c4c3573517d97a90b53ced8261130f7d0074700.
This commit is contained in:
parent
8c4c357351
commit
031d62ca44
@ -425,45 +425,3 @@ export const metricsEmptyTimeAggregateOperatorOptions: SelectOption<
|
||||
string,
|
||||
string
|
||||
>[] = [];
|
||||
|
||||
export const metricsEmptySpaceAggregateOperatorOptions: SelectOption<
|
||||
string,
|
||||
string
|
||||
>[] = [
|
||||
{
|
||||
value: MetricAggregateOperator.SUM,
|
||||
label: 'Sum',
|
||||
},
|
||||
{
|
||||
value: MetricAggregateOperator.AVG,
|
||||
label: 'Avg',
|
||||
},
|
||||
{
|
||||
value: MetricAggregateOperator.MIN,
|
||||
label: 'Min',
|
||||
},
|
||||
{
|
||||
value: MetricAggregateOperator.MAX,
|
||||
label: 'Max',
|
||||
},
|
||||
{
|
||||
value: MetricAggregateOperator.P50,
|
||||
label: 'P50',
|
||||
},
|
||||
{
|
||||
value: MetricAggregateOperator.P75,
|
||||
label: 'P75',
|
||||
},
|
||||
{
|
||||
value: MetricAggregateOperator.P90,
|
||||
label: 'P90',
|
||||
},
|
||||
{
|
||||
value: MetricAggregateOperator.P95,
|
||||
label: 'P95',
|
||||
},
|
||||
{
|
||||
value: MetricAggregateOperator.P99,
|
||||
label: 'P99',
|
||||
},
|
||||
];
|
||||
|
@ -9,8 +9,6 @@ import {
|
||||
PANEL_TYPES,
|
||||
} from 'constants/queryBuilder';
|
||||
import {
|
||||
metricAggregateOperatorOptions,
|
||||
metricsEmptySpaceAggregateOperatorOptions,
|
||||
metricsGaugeSpaceAggregateOperatorOptions,
|
||||
metricsHistogramSpaceAggregateOperatorOptions,
|
||||
metricsSumSpaceAggregateOperatorOptions,
|
||||
@ -23,7 +21,6 @@ import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
|
||||
import { getMetricsOperatorsByAttributeType } from 'lib/newQueryBuilder/getMetricsOperatorsByAttributeType';
|
||||
import { getOperatorsBySourceAndPanelType } from 'lib/newQueryBuilder/getOperatorsBySourceAndPanelType';
|
||||
import { findDataTypeOfOperator } from 'lib/query/findDataTypeOfOperator';
|
||||
import { isEmpty } from 'lodash-es';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { BaseAutocompleteData } from 'types/api/queryBuilder/queryAutocompleteResponse';
|
||||
import {
|
||||
@ -148,14 +145,12 @@ export const useQueryOperations: UseQueryOperations = ({
|
||||
|
||||
const handleMetricAggregateAtributeTypes = useCallback(
|
||||
(aggregateAttribute: BaseAutocompleteData): any => {
|
||||
const newOperators = !isEmpty(aggregateAttribute.type)
|
||||
? getMetricsOperatorsByAttributeType({
|
||||
dataSource: DataSource.METRICS,
|
||||
panelType: panelType || PANEL_TYPES.TIME_SERIES,
|
||||
aggregateAttributeType:
|
||||
(aggregateAttribute.type as ATTRIBUTE_TYPES) || ATTRIBUTE_TYPES.GAUGE,
|
||||
})
|
||||
: metricAggregateOperatorOptions;
|
||||
const newOperators = getMetricsOperatorsByAttributeType({
|
||||
dataSource: DataSource.METRICS,
|
||||
panelType: panelType || PANEL_TYPES.TIME_SERIES,
|
||||
aggregateAttributeType:
|
||||
(aggregateAttribute.type as ATTRIBUTE_TYPES) || ATTRIBUTE_TYPES.GAUGE,
|
||||
});
|
||||
|
||||
switch (aggregateAttribute.type) {
|
||||
case ATTRIBUTE_TYPES.SUM:
|
||||
@ -173,7 +168,7 @@ export const useQueryOperations: UseQueryOperations = ({
|
||||
setSpaceAggregationOptions(metricsHistogramSpaceAggregateOperatorOptions);
|
||||
break;
|
||||
default:
|
||||
setSpaceAggregationOptions(metricsEmptySpaceAggregateOperatorOptions);
|
||||
setSpaceAggregationOptions(metricsGaugeSpaceAggregateOperatorOptions);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -199,12 +194,14 @@ export const useQueryOperations: UseQueryOperations = ({
|
||||
if (newQuery.aggregateAttribute.type === ATTRIBUTE_TYPES.SUM) {
|
||||
newQuery.aggregateOperator = MetricAggregateOperator.RATE;
|
||||
newQuery.timeAggregation = MetricAggregateOperator.RATE;
|
||||
newQuery.spaceAggregation = MetricAggregateOperator.SUM;
|
||||
} else {
|
||||
} else if (newQuery.aggregateAttribute.type === ATTRIBUTE_TYPES.GAUGE) {
|
||||
newQuery.aggregateOperator = MetricAggregateOperator.AVG;
|
||||
newQuery.timeAggregation = MetricAggregateOperator.AVG;
|
||||
newQuery.spaceAggregation = MetricAggregateOperator.AVG;
|
||||
} else {
|
||||
newQuery.timeAggregation = '';
|
||||
}
|
||||
|
||||
newQuery.spaceAggregation = '';
|
||||
}
|
||||
|
||||
handleSetQueryData(index, newQuery);
|
||||
|
Loading…
x
Reference in New Issue
Block a user