From bca08a06fc410099d9c07fc5393079ba1f814c7e Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:43:27 +0100 Subject: [PATCH] [v11.1.x] AzureMonitor: Remove Basic Logs retention warning (#93122) AzureMonitor: Remove Basic Logs retention warning (#92870) Remove retention warning (cherry picked from commit 11c1af0c5f9a8ea9d86420f540a26a14e77ce7db) Co-authored-by: Andreas Christou --- .../LogsQueryEditor/LogsQueryEditor.tsx | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/LogsQueryEditor.tsx b/public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/LogsQueryEditor.tsx index 77da2ba7793..83fddc94b04 100644 --- a/public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/LogsQueryEditor.tsx +++ b/public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/LogsQueryEditor.tsx @@ -19,9 +19,7 @@ import QueryField from './QueryField'; import { TimeManagement } from './TimeManagement'; import { setBasicLogsQuery, setFormatAs, setKustoQuery } from './setQueryValue'; import useMigrations from './useMigrations'; -import { calculateTimeRange, shouldShowBasicLogsToggle } from './utils'; - -const MAX_DATA_RETENTION_DAYS = 8; // limit is only for basic logs +import { shouldShowBasicLogsToggle } from './utils'; interface LogsQueryEditorProps { query: AzureMonitorQuery; @@ -52,7 +50,6 @@ const LogsQueryEditor = ({ const [showBasicLogsToggle, setShowBasicLogsToggle] = useState( shouldShowBasicLogsToggle(query.azureLogAnalytics?.resources || [], basicLogsEnabled) ); - const [showDataRetentionWarning, setShowDataRetentionWarning] = useState(false); const [dataIngestedWarning, setDataIngestedWarning] = useState(null); const templateSrv = getTemplateSrv(); const from = templateSrv?.replace('$__from'); @@ -96,17 +93,6 @@ const LogsQueryEditor = ({ } }, [basicLogsEnabled, onChange, query, showBasicLogsToggle]); - useEffect(() => { - const timeRange = calculateTimeRange(parseInt(from, 10), parseInt(to, 10)); - // Basic logs data retention is fixed at 8 days - // need to add this check to make user aware of this limitation in case they have selected a longer time range - if (showBasicLogsToggle && query.azureLogAnalytics?.basicLogsQuery && timeRange > MAX_DATA_RETENTION_DAYS) { - setShowDataRetentionWarning(true); - } else { - setShowDataRetentionWarning(false); - } - }, [query.azureLogAnalytics?.basicLogsQuery, showBasicLogsToggle, from, to]); - useEffect(() => { const getBasicLogsUsage = async (query: AzureMonitorQuery) => { try { @@ -247,13 +233,6 @@ const LogsQueryEditor = ({ - {showDataRetentionWarning && ( - - - Data retention for Basic Logs is fixed at eight days. You will only see data within this timeframe. - - - )} ); };