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: save rules/dashboard is now enabled for metrics irrespective of feature flag disabled (#2946)

Palash Guptaa6237d8640f6
diff --git a/frontend/src/container/FormAlertRules/index.tsx b/frontend/src/container/FormAlertRules/index.tsx
index e903945fea..9db261afd0 100644
--- a/frontend/src/container/FormAlertRules/index.tsx
+++ b/frontend/src/container/FormAlertRules/index.tsx
@@ -380,8 +380,8 @@ function FormAlertRules({
const isAlertAvialableToSave =
isAlertAvialable &&
- isNewRule &&
- currentQuery.queryType === EQueryType.QUERY_BUILDER;
+ currentQuery.queryType === EQueryType.QUERY_BUILDER &&
+ alertType !== AlertTypes.METRICS_BASED_ALERT;
return (
<>
diff --git a/frontend/src/container/NewWidget/index.tsx b/frontend/src/container/NewWidget/index.tsx
index 2352f506c5..3919f8fe12 100644
--- a/frontend/src/container/NewWidget/index.tsx
+++ b/frontend/src/container/NewWidget/index.tsx
@@ -20,6 +20,8 @@ import {
import { AppState } from 'store/reducers';
import AppActions from 'types/actions';
import { FLUSH_DASHBOARD } from 'types/actions/dashboard';
+import { EQueryType } from 'types/common/dashboard';
+import { DataSource } from 'types/common/queryBuilder';
import AppReducer from 'types/reducer/app';
import DashboardReducer from 'types/reducer/dashboards';
@@ -161,15 +163,29 @@ function NewWidget({ selectedGraph, saveSettingOfPanel }: Props): JSX.Element {
FeatureKeys.QUERY_BUILDER_PANELS,
);
+ const isSaveDisabled = useMemo(
+ () =>
+ isQueryBuilderActive &&
+ currentQuery.queryType === EQueryType.QUERY_BUILDER &&
+ currentQuery.builder.queryData.find(
+ (query) => query.dataSource !== DataSource.METRICS,
+ ) !== undefined,
+ [
+ currentQuery.builder.queryData,
+ currentQuery.queryType,
+ isQueryBuilderActive,
+ ],
+ );
+
return (
<Container>
<ButtonContainer>
- {isQueryBuilderActive && (
+ {isSaveDisabled && (
<Tooltip title={MESSAGE.PANEL}>
<Button
icon={<LockFilled />}
type="primary"
- disabled={isQueryBuilderActive}
+ disabled={isSaveDisabled}
onClick={onSaveDashboard}
>
Save
@@ -177,12 +193,8 @@ function NewWidget({ selectedGraph, saveSettingOfPanel }: Props): JSX.Element {
</Tooltip>
)}
- {!isQueryBuilderActive && (
- <Button
- type="primary"
- disabled={isQueryBuilderActive}
- onClick={onSaveDashboard}
- >
+ {!isSaveDisabled && (
+ <Button type="primary" disabled={isSaveDisabled} onClick={onSaveDashboard}>
Save
</Button>
)}