mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-13 10:09:02 +08:00
fix: resolved issue with promql rule creation (#1422)
This commit is contained in:
parent
bf2f3f8f5e
commit
1b6597b974
@ -177,25 +177,26 @@ function FormAlertRules({
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.keys(metricQueries).forEach((key) => {
|
if (queryCategory === EQueryType.QUERY_BUILDER) {
|
||||||
if (metricQueries[key].metricName === '') {
|
Object.keys(metricQueries).forEach((key) => {
|
||||||
retval = false;
|
if (metricQueries[key].metricName === '') {
|
||||||
notification.error({
|
retval = false;
|
||||||
message: 'Error',
|
notification.error({
|
||||||
description: t('metricname_missing', { where: metricQueries[key].name }),
|
message: 'Error',
|
||||||
});
|
description: t('metricname_missing', { where: metricQueries[key].name }),
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
|
});
|
||||||
Object.keys(formulaQueries).forEach((key) => {
|
Object.keys(formulaQueries).forEach((key) => {
|
||||||
if (formulaQueries[key].expression === '') {
|
if (formulaQueries[key].expression === '') {
|
||||||
retval = false;
|
retval = false;
|
||||||
notification.error({
|
notification.error({
|
||||||
message: 'Error',
|
message: 'Error',
|
||||||
description: t('expression_missing', formulaQueries[key].name),
|
description: t('expression_missing', formulaQueries[key].name),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}, [t, alertDef, queryCategory, metricQueries, formulaQueries, promQueries]);
|
}, [t, alertDef, queryCategory, metricQueries, formulaQueries, promQueries]);
|
||||||
@ -235,7 +236,7 @@ function FormAlertRules({
|
|||||||
description:
|
description:
|
||||||
!ruleId || ruleId === 0 ? t('rule_created') : t('rule_edited'),
|
!ruleId || ruleId === 0 ? t('rule_created') : t('rule_edited'),
|
||||||
});
|
});
|
||||||
console.log('invalidting cache');
|
|
||||||
// invalidate rule in cache
|
// invalidate rule in cache
|
||||||
ruleCache.invalidateQueries(['ruleId', ruleId]);
|
ruleCache.invalidateQueries(['ruleId', ruleId]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user