diff --git a/frontend/public/locales/en-GB/alerts.json b/frontend/public/locales/en-GB/alerts.json
index cae309fd45..fa2d9516fe 100644
--- a/frontend/public/locales/en-GB/alerts.json
+++ b/frontend/public/locales/en-GB/alerts.json
@@ -28,6 +28,7 @@
"condition_required": "at least one metric condition is required",
"alertname_required": "alert name is required",
"promql_required": "promql expression is required when query format is set to PromQL",
+ "chquery_required": "query is required when query format is set to ClickHouse",
"button_savechanges": "Save Rule",
"button_createrule": "Create Rule",
"button_returntorules": "Return to rules",
@@ -55,6 +56,7 @@
"button_formula": "Formula",
"tab_qb": "Query Builder",
"tab_promql": "PromQL",
+ "tab_chquery": "ClickHouse Query",
"title_confirm": "Confirm",
"button_ok": "Yes",
"button_cancel": "No",
@@ -88,5 +90,21 @@
"user_guide_pql_step3": "Step 3 -Alert Configuration",
"user_guide_pql_step3a": "Set alert severity, name and descriptions",
"user_guide_pql_step3b": "Add tags to the alert in the Label field if needed",
- "user_tooltip_more_help": "More details on how to create alerts"
+ "user_guide_ch_step1": "Step 1 - Define the metric",
+ "user_guide_ch_step1a": "Write a Clickhouse query for alert evaluation. Follow <0>this tutorial0> to learn about query format and supported vars.",
+ "user_guide_ch_step1b": "Format the legends based on labels you want to highlight in the preview chart",
+ "user_guide_ch_step2": "Step 2 - Define Alert Conditions",
+ "user_guide_ch_step2a": "Select the threshold type and whether you want to alert above/below a value",
+ "user_guide_ch_step2b": "Enter the Alert threshold",
+ "user_guide_ch_step3": "Step 3 -Alert Configuration",
+ "user_guide_ch_step3a": "Set alert severity, name and descriptions",
+ "user_guide_ch_step3b": "Add tags to the alert in the Label field if needed",
+ "user_tooltip_more_help": "More details on how to create alerts",
+ "choose_alert_type": "Choose a type for the alert:",
+ "metric_based_alert": "Metric based Alert",
+ "metric_based_alert_desc": "Send a notification when a condition occurs in metric data",
+ "log_based_alert": "Log-based Alert",
+ "log_based_alert_desc": "Send a notification when a condition occurs in logs data.",
+ "traces_based_alert": "Trace-based Alert",
+ "traces_based_alert_desc": "Send a notification when a condition occurs in traces data."
}
\ No newline at end of file
diff --git a/frontend/public/locales/en/alerts.json b/frontend/public/locales/en/alerts.json
index cae309fd45..fa2d9516fe 100644
--- a/frontend/public/locales/en/alerts.json
+++ b/frontend/public/locales/en/alerts.json
@@ -28,6 +28,7 @@
"condition_required": "at least one metric condition is required",
"alertname_required": "alert name is required",
"promql_required": "promql expression is required when query format is set to PromQL",
+ "chquery_required": "query is required when query format is set to ClickHouse",
"button_savechanges": "Save Rule",
"button_createrule": "Create Rule",
"button_returntorules": "Return to rules",
@@ -55,6 +56,7 @@
"button_formula": "Formula",
"tab_qb": "Query Builder",
"tab_promql": "PromQL",
+ "tab_chquery": "ClickHouse Query",
"title_confirm": "Confirm",
"button_ok": "Yes",
"button_cancel": "No",
@@ -88,5 +90,21 @@
"user_guide_pql_step3": "Step 3 -Alert Configuration",
"user_guide_pql_step3a": "Set alert severity, name and descriptions",
"user_guide_pql_step3b": "Add tags to the alert in the Label field if needed",
- "user_tooltip_more_help": "More details on how to create alerts"
+ "user_guide_ch_step1": "Step 1 - Define the metric",
+ "user_guide_ch_step1a": "Write a Clickhouse query for alert evaluation. Follow <0>this tutorial0> to learn about query format and supported vars.",
+ "user_guide_ch_step1b": "Format the legends based on labels you want to highlight in the preview chart",
+ "user_guide_ch_step2": "Step 2 - Define Alert Conditions",
+ "user_guide_ch_step2a": "Select the threshold type and whether you want to alert above/below a value",
+ "user_guide_ch_step2b": "Enter the Alert threshold",
+ "user_guide_ch_step3": "Step 3 -Alert Configuration",
+ "user_guide_ch_step3a": "Set alert severity, name and descriptions",
+ "user_guide_ch_step3b": "Add tags to the alert in the Label field if needed",
+ "user_tooltip_more_help": "More details on how to create alerts",
+ "choose_alert_type": "Choose a type for the alert:",
+ "metric_based_alert": "Metric based Alert",
+ "metric_based_alert_desc": "Send a notification when a condition occurs in metric data",
+ "log_based_alert": "Log-based Alert",
+ "log_based_alert_desc": "Send a notification when a condition occurs in logs data.",
+ "traces_based_alert": "Trace-based Alert",
+ "traces_based_alert_desc": "Send a notification when a condition occurs in traces data."
}
\ No newline at end of file
diff --git a/frontend/src/container/CreateAlertRule/SelectAlertType/index.tsx b/frontend/src/container/CreateAlertRule/SelectAlertType/index.tsx
new file mode 100644
index 0000000000..e892f3ac22
--- /dev/null
+++ b/frontend/src/container/CreateAlertRule/SelectAlertType/index.tsx
@@ -0,0 +1,62 @@
+import React from 'react';
+import { useTranslation } from 'react-i18next';
+import { AlertTypes } from 'types/api/alerts/alertTypes';
+
+import { AlertTypeCard, AlertTypeCards, SelectTypeContainer } from './styles';
+
+interface OptionType {
+ title: string;
+ selection: AlertTypes;
+ description: string;
+}
+
+function SelectAlertType({ onSelect }: SelectAlertTypeProps): JSX.Element {
+ const { t } = useTranslation(['alerts']);
+
+ const renderOptions = (): JSX.Element => {
+ const optionList: OptionType[] = [
+ {
+ title: t('metric_based_alert'),
+ selection: AlertTypes.METRICS_BASED_ALERT,
+ description: t('metric_based_alert_desc'),
+ },
+ {
+ title: t('log_based_alert'),
+ selection: AlertTypes.LOGS_BASED_ALERT,
+ description: t('log_based_alert_desc'),
+ },
+ {
+ title: t('traces_based_alert'),
+ selection: AlertTypes.TRACES_BASED_ALERT,
+ description: t('traces_based_alert_desc'),
+ },
+ ];
+ return (
+ <>
+ {optionList.map((o: OptionType) => (
+ {
+ onSelect(o.selection);
+ }}
+ >
+ {o.description}
+
+ ))}
+ >
+ );
+ };
+ return (
+
+