diff --git a/public/app/features/alerting/unified/utils/rule-form.ts b/public/app/features/alerting/unified/utils/rule-form.ts index 5afa362d00f..c0504c75b99 100644 --- a/public/app/features/alerting/unified/utils/rule-form.ts +++ b/public/app/features/alerting/unified/utils/rule-form.ts @@ -681,95 +681,6 @@ const getDefaultExpressionsForRecording = (refOne: string): Array { - const reduceExpression: ExpressionQuery = { - refId: reduceRefId, - type: ExpressionQueryType.reduce, - datasource: { - uid: ExpressionDatasourceUID, - type: ExpressionDatasourceRef.type, - }, - conditions: [ - { - type: 'query', - evaluator: { - params: [], - type: EvalFunction.IsAbove, - }, - operator: { - type: 'and', - }, - query: { - params: [], - }, - reducer: { - params: [], - type: 'last', - }, - }, - ], - reducer: 'last', - expression: inputRefId, - }; - - return { - refId: reduceRefId, - datasourceUid: ExpressionDatasourceUID, - queryType: '', - model: reduceExpression, - }; -} - -function getDefaultThresholdExpression({ - inputRefId, - thresholdRefId, -}: { - inputRefId: string; - thresholdRefId: string; -}): AlertQuery { - const thresholdExpression: ExpressionQuery = { - refId: thresholdRefId, - type: ExpressionQueryType.threshold, - datasource: { - uid: ExpressionDatasourceUID, - type: ExpressionDatasourceRef.type, - }, - conditions: [ - { - type: 'query', - evaluator: { - params: [0], - type: EvalFunction.IsAbove, - }, - operator: { - type: 'and', - }, - query: { - params: [], - }, - reducer: { - params: [], - type: 'last', - }, - }, - ], - expression: inputRefId, - }; - - return { - refId: thresholdRefId, - datasourceUid: ExpressionDatasourceUID, - queryType: '', - model: thresholdExpression, - }; -} - const dataQueriesToGrafanaQueries = async ( queries: DataQuery[], relativeTimeRange: RelativeTimeRange,