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: interval is blocked for custom time selection (#2146)

Palash Gupta3115b32dcde2
diff --git a/frontend/src/container/TopNav/AutoRefresh/index.tsx b/frontend/src/container/TopNav/AutoRefresh/index.tsx
index ba0d4bb3e6..ab02e27a3d 100644
--- a/frontend/src/container/TopNav/AutoRefresh/index.tsx
+++ b/frontend/src/container/TopNav/AutoRefresh/index.tsx
@@ -37,8 +37,11 @@ function AutoRefresh({ disabled = false }: AutoRefreshProps): JSX.Element {
const { pathname } = useLocation();
const isDisabled = useMemo(
- () => disabled || globalTime.isAutoRefreshDisabled,
- [globalTime.isAutoRefreshDisabled, disabled],
+ () =>
+ disabled ||
+ globalTime.isAutoRefreshDisabled ||
+ globalTime.selectedTime === 'custom',
+ [globalTime.isAutoRefreshDisabled, disabled, globalTime.selectedTime],
);
const localStorageData = JSON.parse(get(DASHBOARD_TIME_IN_DURATION) || '{}');
@@ -132,6 +135,11 @@ function AutoRefresh({ disabled = false }: AutoRefreshProps): JSX.Element {
[localStorageData, pathname],
);
+ if (globalTime.selectedTime === 'custom') {
+ // eslint-disable-next-line react/jsx-no-useless-fragment
+ return <></>;
+ }
+
return (
<Popover
placement="bottomLeft"
diff --git a/frontend/src/container/TopNav/DateTimeSelection/index.tsx b/frontend/src/container/TopNav/DateTimeSelection/index.tsx
index 9a18b65759..91567db64d 100644
--- a/frontend/src/container/TopNav/DateTimeSelection/index.tsx
+++ b/frontend/src/container/TopNav/DateTimeSelection/index.tsx
@@ -88,6 +88,14 @@ function DateTimeSelection({
return timeInterval;
};
+ useEffect(() => {
+ if (selectedTime === 'custom') {
+ setRefreshButtonHidden(true);
+ } else {
+ setRefreshButtonHidden(false);
+ }
+ }, [selectedTime]);
+
const getDefaultTime = (pathName: string): Time => {
const defaultSelectedOption = getDefaultOption(pathName);