Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix: resolved issue with promql rule creation (#1422)

Amol Umbark1b6597b9743b
diff --git a/frontend/src/container/FormAlertRules/index.tsx b/frontend/src/container/FormAlertRules/index.tsx
index 38fcaad04d..440b20238f 100644
--- a/frontend/src/container/FormAlertRules/index.tsx
+++ b/frontend/src/container/FormAlertRules/index.tsx
@@ -177,25 +177,26 @@ function FormAlertRules({
return false;
}
- Object.keys(metricQueries).forEach((key) => {
- if (metricQueries[key].metricName === '') {
- retval = false;
- notification.error({
- message: 'Error',
- description: t('metricname_missing', { where: metricQueries[key].name }),
- });
- }
- });
-
- Object.keys(formulaQueries).forEach((key) => {
- if (formulaQueries[key].expression === '') {
- retval = false;
- notification.error({
- message: 'Error',
- description: t('expression_missing', formulaQueries[key].name),
- });
- }
- });
+ if (queryCategory === EQueryType.QUERY_BUILDER) {
+ Object.keys(metricQueries).forEach((key) => {
+ if (metricQueries[key].metricName === '') {
+ retval = false;
+ notification.error({
+ message: 'Error',
+ description: t('metricname_missing', { where: metricQueries[key].name }),
+ });
+ }
+ });
+ Object.keys(formulaQueries).forEach((key) => {
+ if (formulaQueries[key].expression === '') {
+ retval = false;
+ notification.error({
+ message: 'Error',
+ description: t('expression_missing', formulaQueries[key].name),
+ });
+ }
+ });
+ }
return retval;
}, [t, alertDef, queryCategory, metricQueries, formulaQueries, promQueries]);
@@ -235,7 +236,7 @@ function FormAlertRules({
description:
!ruleId || ruleId === 0 ? t('rule_created') : t('rule_edited'),
});
- console.log('invalidting cache');
+
// invalidate rule in cache
ruleCache.invalidateQueries(['ruleId', ruleId]);