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.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
feat(base-path): replace window.open with openInNewTab for internal paths and upgraded lint to error (#11027)
SagarRajput-7535ee9900c23
diff --git a/frontend/.oxlintrc.json b/frontend/.oxlintrc.jsonindex ae04df52bb..a93ebed989 100644--- a/frontend/.oxlintrc.json+++ b/frontend/.oxlintrc.json@@ -286,7 +286,7 @@// Prevents useStore.getState() - export standalone actions instead"signoz/no-navigator-clipboard": "error",// Prevents navigator.clipboard - use useCopyToClipboard hook instead (disabled in tests via override)- "signoz/no-raw-absolute-path": "warn",+ "signoz/no-raw-absolute-path": "error",// Prevents window.open(path), window.location.origin + path, window.location.href = path"no-restricted-imports": ["error",diff --git a/frontend/index.html b/frontend/index.htmlindex d4e56a86ef..da790fc02e 100644--- a/frontend/index.html+++ b/frontend/index.html@@ -40,12 +40,12 @@<metadata-react-helmet="true"property="og:image"- content="/images/signoz-hero-image.webp"+ content="[[.BaseHref]]images/signoz-hero-image.webp"/><metadata-react-helmet="true"name="twitter:image"- content="/images/signoz-hero-image.webp"+ content="[[.BaseHref]]images/signoz-hero-image.webp"/><metadata-react-helmet="true"diff --git a/frontend/src/components/ChatSupportGateway/ChatSupportGateway.tsx b/frontend/src/components/ChatSupportGateway/ChatSupportGateway.tsxindex 4c7fd2286b..f7258690d2 100644--- a/frontend/src/components/ChatSupportGateway/ChatSupportGateway.tsx+++ b/frontend/src/components/ChatSupportGateway/ChatSupportGateway.tsx@@ -9,6 +9,7 @@ import { CreditCard, MessageSquareText, X } from 'lucide-react';import { SuccessResponseV2 } from 'types/api';import { CheckoutSuccessPayloadProps } from 'types/api/billing/checkout';import APIError from 'types/api/error';+import { getBaseUrl } from 'utils/basePath';export default function ChatSupportGateway(): JSX.Element {const { notifications } = useNotifications();@@ -54,7 +55,7 @@ export default function ChatSupportGateway(): JSX.Element {});updateCreditCard({- url: window.location.origin,+ url: getBaseUrl(),});};diff --git a/frontend/src/components/EditMemberDrawer/EditMemberDrawer.tsx b/frontend/src/components/EditMemberDrawer/EditMemberDrawer.tsxindex 040d545556..8992c45542 100644--- a/frontend/src/components/EditMemberDrawer/EditMemberDrawer.tsx+++ b/frontend/src/components/EditMemberDrawer/EditMemberDrawer.tsx@@ -28,6 +28,7 @@ import { useAppContext } from 'providers/App/App';import { useErrorModal } from 'providers/ErrorModalProvider';import { useTimezone } from 'providers/Timezone';import APIError from 'types/api/error';+import { getAbsoluteUrl } from 'utils/basePath';import { toAPIError } from 'utils/errorUtils';import DeleteMemberDialog from './DeleteMemberDialog';@@ -381,7 +382,7 @@ function EditMemberDrawer({pathParams: { id: member.id },});if (response?.data?.token) {- const link = `${window.location.origin}/password-reset?token=${response.data.token}`;+ const link = getAbsoluteUrl(`/password-reset?token=${response.data.token}`);setResetLink(link);setResetLinkExpiresAt(response.data.expiresAtdiff --git a/frontend/src/components/HeaderRightSection/ShareURLModal.tsx b/frontend/src/components/HeaderRightSection/ShareURLModal.tsxindex 00553ea442..3e2012ab6e 100644--- a/frontend/src/components/HeaderRightSection/ShareURLModal.tsx+++ b/frontend/src/components/HeaderRightSection/ShareURLModal.tsx@@ -13,6 +13,7 @@ import GetMinMax from 'lib/getMinMax';import { Check, Info, Link2 } from 'lucide-react';import { AppState } from 'store/reducers';import { GlobalReducer } from 'types/reducer/globalTime';+import { getAbsoluteUrl } from 'utils/basePath';const routesToBeSharedWithTime = [ROUTES.LOGS_EXPLORER,@@ -80,17 +81,13 @@ function ShareURLModal(): JSX.Element {urlQuery.delete(QueryParams.relativeTime);- currentUrl = `${window.location.origin}${- location.pathname- }?${urlQuery.toString()}`;+ currentUrl = getAbsoluteUrl(`${location.pathname}?${urlQuery.toString()}`);} else {urlQuery.delete(QueryParams.startTime);urlQuery.delete(QueryParams.endTime);urlQuery.set(QueryParams.relativeTime, selectedTime);- currentUrl = `${window.location.origin}${- location.pathname- }?${urlQuery.toString()}`;+ currentUrl = getAbsoluteUrl(`${location.pathname}?${urlQuery.toString()}`);}}diff --git a/frontend/src/components/InviteMembersModal/InviteMembersModal.tsx b/frontend/src/components/InviteMembersModal/InviteMembersModal.tsxindex 08429b49fb..1e525c5488 100644--- a/frontend/src/components/InviteMembersModal/InviteMembersModal.tsx+++ b/frontend/src/components/InviteMembersModal/InviteMembersModal.tsx@@ -17,6 +17,7 @@ import { useErrorModal } from 'providers/ErrorModalProvider';import APIError from 'types/api/error';import { ROLES } from 'types/roles';import { EMAIL_REGEX } from 'utils/app';+import { getBaseUrl } from 'utils/basePath';import { popupContainer } from 'utils/selectPopupContainer';import { v4 as uuid } from 'uuid';@@ -191,7 +192,7 @@ function InviteMembersModal({email: row.email.trim(),name: '',role: row.role as ROLES,- frontendBaseUrl: window.location.origin,+ frontendBaseUrl: getBaseUrl(),});} else {await inviteUsers({@@ -199,7 +200,7 @@ function InviteMembersModal({email: row.email.trim(),name: '',role: row.role,- frontendBaseUrl: window.location.origin,+ frontendBaseUrl: getBaseUrl(),})),});}diff --git a/frontend/src/components/LaunchChatSupport/LaunchChatSupport.tsx b/frontend/src/components/LaunchChatSupport/LaunchChatSupport.tsxindex 8cacfe400c..d69b10dd31 100644--- a/frontend/src/components/LaunchChatSupport/LaunchChatSupport.tsx+++ b/frontend/src/components/LaunchChatSupport/LaunchChatSupport.tsx@@ -14,6 +14,7 @@ import { useAppContext } from 'providers/App/App';import { SuccessResponseV2 } from 'types/api';import { CheckoutSuccessPayloadProps } from 'types/api/billing/checkout';import APIError from 'types/api/error';+import { getBaseUrl } from 'utils/basePath';import './LaunchChatSupport.styles.scss';@@ -154,7 +155,7 @@ function LaunchChatSupport({});updateCreditCard({- url: window.location.origin,+ url: getBaseUrl(),});};diff --git a/frontend/src/components/LearnMore/LearnMore.tsx b/frontend/src/components/LearnMore/LearnMore.tsxindex 3b7381c09d..ab1be771f6 100644--- a/frontend/src/components/LearnMore/LearnMore.tsx+++ b/frontend/src/components/LearnMore/LearnMore.tsx@@ -1,6 +1,7 @@import { Color } from '@signozhq/design-tokens';import { Button } from 'antd';import { ArrowUpRight } from 'lucide-react';+import { openInNewTab } from 'utils/navigation';import './LearnMore.styles.scss';@@ -14,7 +15,7 @@ function LearnMore({ text, url, onClick }: LearnMoreProps): JSX.Element {const handleClick = (): void => {onClick?.();if (url) {- window.open(url, '_blank');+ openInNewTab(url);}};return (diff --git a/frontend/src/components/MessagingQueueHealthCheck/AttributeCheckList.tsx b/frontend/src/components/MessagingQueueHealthCheck/AttributeCheckList.tsxindex 6024befe61..5648c2ca15 100644--- a/frontend/src/components/MessagingQueueHealthCheck/AttributeCheckList.tsx+++ b/frontend/src/components/MessagingQueueHealthCheck/AttributeCheckList.tsx@@ -20,6 +20,7 @@ import {KAFKA_SETUP_DOC_LINK,MessagingQueueHealthCheckService,} from 'pages/MessagingQueues/MessagingQueuesUtils';+import { openInNewTab } from 'utils/navigation';import { v4 as uuid } from 'uuid';import './MessagingQueueHealthCheck.styles.scss';@@ -76,7 +77,7 @@ function ErrorTitleAndKey({if (isCloudUserVal && !!link) {history.push(link);} else {- window.open(KAFKA_SETUP_DOC_LINK, '_blank');+ openInNewTab(KAFKA_SETUP_DOC_LINK);}};return {diff --git a/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/components/DependentServices.tsx b/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/components/DependentServices.tsxindex 9a33a9509e..6a56cf724e 100644--- a/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/components/DependentServices.tsx+++ b/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/components/DependentServices.tsx@@ -9,6 +9,7 @@ import {} from 'container/ApiMonitoring/utils';import { UnfoldVertical } from 'lucide-react';import { SuccessResponse } from 'types/api';+import { openInNewTab } from 'utils/navigation';import emptyStateUrl from '@/assets/Icons/emptyState.svg';@@ -94,20 +95,14 @@ function DependentServices({}}onRow={(record): { onClick: () => void; className: string } => ({onClick: (): void => {- const url = new URL(- `/services/${- record.serviceData.serviceName &&- record.serviceData.serviceName !== '-'- ? record.serviceData.serviceName- : ''- }`,- window.location.origin,- );+ const serviceName =+ record.serviceData.serviceName && record.serviceData.serviceName !== '-'+ ? record.serviceData.serviceName+ : '';const urlQuery = new URLSearchParams();urlQuery.set(QueryParams.startTime, timeRange.startTime.toString());urlQuery.set(QueryParams.endTime, timeRange.endTime.toString());- url.search = urlQuery.toString();- window.open(url.toString(), '_blank');+ openInNewTab(`/services/${serviceName}?${urlQuery.toString()}`);},className: 'clickable-row',})}diff --git a/frontend/src/container/AppLayout/index.tsx b/frontend/src/container/AppLayout/index.tsxindex 4956e18a97..337c4ae079 100644--- a/frontend/src/container/AppLayout/index.tsx+++ b/frontend/src/container/AppLayout/index.tsx@@ -73,6 +73,7 @@ import {import { UserPreference } from 'types/api/preferences/preference';import AppReducer from 'types/reducer/app';import { USER_ROLES } from 'types/roles';+import { getBaseUrl } from 'utils/basePath';import { showErrorNotification } from 'utils/error';import { eventEmitter } from 'utils/getEventEmitter';import {@@ -461,7 +462,7 @@ function AppLayout(props: AppLayoutProps): JSX.Element {const handleFailedPayment = useCallback((): void => {manageCreditCard({- url: window.location.origin,+ url: getBaseUrl(),});}, [manageCreditCard]);diff --git a/frontend/src/container/BillingContainer/BillingContainer.tsx b/frontend/src/container/BillingContainer/BillingContainer.tsxindex fd66dcb20a..c6792b7316 100644--- a/frontend/src/container/BillingContainer/BillingContainer.tsx+++ b/frontend/src/container/BillingContainer/BillingContainer.tsx@@ -31,6 +31,7 @@ import { isEmpty, pick } from 'lodash-es';import { useAppContext } from 'providers/App/App';import { SuccessResponseV2 } from 'types/api';import { CheckoutSuccessPayloadProps } from 'types/api/billing/checkout';+import { getBaseUrl } from 'utils/basePath';import { getFormattedDate, getRemainingDays } from 'utils/timeUtils';import { BillingUsageGraph } from './BillingUsageGraph/BillingUsageGraph';@@ -324,7 +325,7 @@ export default function BillingContainer(): JSX.Element {});updateCreditCard({- url: window.location.origin,+ url: getBaseUrl(),});} else {logEvent('Billing : Manage Billing', {@@ -333,7 +334,7 @@ export default function BillingContainer(): JSX.Element {});manageCreditCard({- url: window.location.origin,+ url: getBaseUrl(),});}// eslint-disable-next-line react-hooks/exhaustive-depsdiff --git a/frontend/src/container/CreateAlertRule/SelectAlertType/index.tsx b/frontend/src/container/CreateAlertRule/SelectAlertType/index.tsxindex 8d3725533e..890241d3b1 100644--- a/frontend/src/container/CreateAlertRule/SelectAlertType/index.tsx+++ b/frontend/src/container/CreateAlertRule/SelectAlertType/index.tsx@@ -7,6 +7,7 @@ import { FeatureKeys } from 'constants/features';import { useAppContext } from 'providers/App/App';import { AlertTypes } from 'types/api/alerts/alertTypes';import { isModifierKeyPressed } from 'utils/app';+import { openInNewTab } from 'utils/navigation';import { getOptionList } from './config';import { AlertTypeCard, SelectTypeContainer } from './styles';@@ -55,7 +56,7 @@ function SelectAlertType({ onSelect }: SelectAlertTypeProps): JSX.Element {page: 'New alert data source selection page',});- window.open(url, '_blank');+ openInNewTab(url);}const renderOptions = useMemo(() => (diff --git a/frontend/src/container/CreateAlertV2/AlertCondition/utils.tsx b/frontend/src/container/CreateAlertV2/AlertCondition/utils.tsxindex b7cf015cc8..3f4b0c9b6b 100644--- a/frontend/src/container/CreateAlertV2/AlertCondition/utils.tsx+++ b/frontend/src/container/CreateAlertV2/AlertCondition/utils.tsx@@ -14,6 +14,7 @@ import { IUser } from 'providers/App/types';import { Query } from 'types/api/queryBuilder/queryBuilderData';import { EQueryType } from 'types/common/dashboard';import { USER_ROLES } from 'types/roles';+import { openInNewTab } from 'utils/navigation';import { ROUTING_POLICIES_ROUTE } from './constants';import { RoutingPolicyBannerProps } from './types';@@ -387,7 +388,7 @@ export function NotificationChannelsNotFoundContent({style={{ padding: '0 4px' }}type="link"onClick={(): void => {- window.open(ROUTES.CHANNELS_NEW, '_blank');+ openInNewTab(ROUTES.CHANNELS_NEW);}}>here.diff --git a/frontend/src/container/CustomDomainSettings/CustomDomainSettings.tsx b/frontend/src/container/CustomDomainSettings/CustomDomainSettings.tsxindex 22fe5075b2..d4774a681d 100644--- a/frontend/src/container/CustomDomainSettings/CustomDomainSettings.tsx+++ b/frontend/src/container/CustomDomainSettings/CustomDomainSettings.tsx@@ -46,6 +46,7 @@ function DomainUpdateToast({className="custom-domain-toast-visit-btn"suffix={<ExternalLink size={12} />}onClick={(): void => {+ // oxlint-disable-next-line signoz/no-raw-absolute-pathwindow.open(url, '_blank', 'noopener,noreferrer');}}>@@ -74,10 +75,8 @@ export default function CustomDomainSettings(): JSX.Element {const [isPollingEnabled, setIsPollingEnabled] = useState(false);const [hosts, setHosts] = useState<ZeustypesHostDTO[] | null>(null);- const [- updateDomainError,- setUpdateDomainError,- ] = useState<AxiosError<RenderErrorResponseDTO> | null>(null);+ const [updateDomainError, setUpdateDomainError] =+ useState<AxiosError<RenderErrorResponseDTO> | null>(null);const [customDomainSubdomain, setCustomDomainSubdomain] = useState<string | undefined@@ -90,10 +89,8 @@ export default function CustomDomainSettings(): JSX.Element {refetch: refetchHosts,} = useGetHosts();- const {- mutate: updateSubDomain,- isLoading: isLoadingUpdateCustomDomain,- } = usePutHost<AxiosError<RenderErrorResponseDTO>>();+ const { mutate: updateSubDomain, isLoading: isLoadingUpdateCustomDomain } =+ usePutHost<AxiosError<RenderErrorResponseDTO>>();const stripProtocol = (url: string): string => url?.split('://')[1] ?? url;@@ -137,7 +134,7 @@ export default function CustomDomainSettings(): JSX.Element {{onSuccess: () => {setIsPollingEnabled(true);- refetchHosts();+ void refetchHosts();setIsEditModalOpen(false);setCustomDomainSubdomain(subdomain);const newUrl = `https://${subdomain}.${dnsSuffix}`;diff --git a/frontend/src/container/DashboardContainer/DashboardSettings/PublicDashboard/index.tsx b/frontend/src/container/DashboardContainer/DashboardSettings/PublicDashboard/index.tsxindex 380a314e1a..8665d0a870 100644--- a/frontend/src/container/DashboardContainer/DashboardSettings/PublicDashboard/index.tsx+++ b/frontend/src/container/DashboardContainer/DashboardSettings/PublicDashboard/index.tsx@@ -15,6 +15,8 @@ import { useDashboardStore } from 'providers/Dashboard/store/useDashboardStore';import { PublicDashboardMetaProps } from 'types/api/dashboard/public/getMeta';import APIError from 'types/api/error';import { USER_ROLES } from 'types/roles';+import { getAbsoluteUrl } from 'utils/basePath';+import { openInNewTab } from 'utils/navigation';import './PublicDashboard.styles.scss';@@ -212,7 +214,7 @@ function PublicDashboardSetting(): JSX.Element {try {setCopyPublicDashboardURL(- `${window.location.origin}${publicDashboardResponse?.data?.publicPath}`,+ getAbsoluteUrl(publicDashboardResponse?.data?.publicPath ?? ''),);toast.success('Copied Public Dashboard URL successfully');} catch (error) {@@ -221,7 +223,7 @@ function PublicDashboardSetting(): JSX.Element {};const publicDashboardURL = useMemo(- () => `${window.location.origin}${publicDashboardResponse?.data?.publicPath}`,+ () => getAbsoluteUrl(publicDashboardResponse?.data?.publicPath ?? ''),[publicDashboardResponse],);@@ -294,7 +296,7 @@ function PublicDashboardSetting(): JSX.Element {icon={<ExternalLink size={12} />}onClick={(): void => {if (publicDashboardURL) {- window.open(publicDashboardURL, '_blank');+ openInNewTab(publicDashboardURL);}}}/>diff --git a/frontend/src/container/ForgotPassword/index.tsx b/frontend/src/container/ForgotPassword/index.tsxindex de1cab122f..ee667d170f 100644--- a/frontend/src/container/ForgotPassword/index.tsx+++ b/frontend/src/container/ForgotPassword/index.tsx@@ -9,6 +9,7 @@ import ROUTES from 'constants/routes';import history from 'lib/history';import APIError from 'types/api/error';import { OrgSessionContext } from 'types/api/v2/sessions/context/get';+import { getBaseUrl } from 'utils/basePath';import tvUrl from '@/assets/svgs/tv.svg';@@ -104,7 +105,7 @@ function ForgotPassword({data: {email: values.email,orgId: currentOrgId,- frontendBaseURL: window.location.origin,+ frontendBaseURL: getBaseUrl(),},});}, [form, forgotPasswordMutate, initialOrgId, hasMultipleOrgs]);diff --git a/frontend/src/container/FormAlertRules/BasicInfo.tsx b/frontend/src/container/FormAlertRules/BasicInfo.tsxindex 4a57d59836..2be3d44162 100644--- a/frontend/src/container/FormAlertRules/BasicInfo.tsx+++ b/frontend/src/container/FormAlertRules/BasicInfo.tsx@@ -15,6 +15,7 @@ import { AlertDef, Labels } from 'types/api/alerts/def';import { Channels } from 'types/api/channels/getAll';import APIError from 'types/api/error';import { requireErrorMessage } from 'utils/form/requireErrorMessage';+import { openInNewTab } from 'utils/navigation';import { popupContainer } from 'utils/selectPopupContainer';import ChannelSelect from './ChannelSelect';@@ -87,7 +88,7 @@ function BasicInfo({dataSource: ALERTS_DATA_SOURCE_MAP[alertDef?.alertType as AlertTypes],ruleId: isNewRule ? 0 : alertDef?.id,});- window.open(ROUTES.CHANNELS_NEW, '_blank');+ openInNewTab(ROUTES.CHANNELS_NEW);// eslint-disable-next-line react-hooks/exhaustive-deps}, []);const hasLoggedEvent = useRef(false);diff --git a/frontend/src/container/FormAlertRules/index.tsx b/frontend/src/container/FormAlertRules/index.tsxindex 8ec71856e9..1741974e7b 100644--- a/frontend/src/container/FormAlertRules/index.tsx+++ b/frontend/src/container/FormAlertRules/index.tsx@@ -55,6 +55,7 @@ import { DataSource } from 'types/common/queryBuilder';import { GlobalReducer } from 'types/reducer/globalTime';import { isModifierKeyPressed } from 'utils/app';import { compositeQueryToQueryEnvelope } from 'utils/compositeQueryToQueryEnvelope';+import { openInNewTab } from 'utils/navigation';import BasicInfo from './BasicInfo';import ChartPreview from './ChartPreview';@@ -777,7 +778,7 @@ function FormAlertRules({queryType: currentQuery.queryType,link: url,});- window.open(url, '_blank');+ openInNewTab(url);}}diff --git a/frontend/src/container/Home/Dashboards/Dashboards.tsx b/frontend/src/container/Home/Dashboards/Dashboards.tsxindex 12ccc04d10..3d576b185f 100644--- a/frontend/src/container/Home/Dashboards/Dashboards.tsx+++ b/frontend/src/container/Home/Dashboards/Dashboards.tsx@@ -10,6 +10,7 @@ import Card from 'periscope/components/Card/Card';import { useAppContext } from 'providers/App/App';import { Dashboard } from 'types/api/dashboard/getAll';import { USER_ROLES } from 'types/roles';+import { openInNewTab } from 'utils/navigation';import dialsUrl from '@/assets/Icons/dials.svg';@@ -114,7 +115,7 @@ export default function Dashboards({dashboardName: dashboard.data.title,});if (event.metaKey || event.ctrlKey) {- window.open(getLink(), '_blank');+ openInNewTab(getLink());} else {safeNavigate(getLink());}diff --git a/frontend/src/container/Home/DataSourceInfo/DataSourceInfo.tsx b/frontend/src/container/Home/DataSourceInfo/DataSourceInfo.tsxindex 91205aa677..fe01440d5a 100644--- a/frontend/src/container/Home/DataSourceInfo/DataSourceInfo.tsx+++ b/frontend/src/container/Home/DataSourceInfo/DataSourceInfo.tsx@@ -9,6 +9,7 @@ import { Link2 } from 'lucide-react';import Card from 'periscope/components/Card/Card';import { useAppContext } from 'providers/App/App';import { LicensePlatform } from 'types/api/licensesV3/getActive';+import { openInNewTab } from 'utils/navigation';import containerPlusUrl from '@/assets/Icons/container-plus.svg';import helloWaveUrl from '@/assets/Icons/hello-wave.svg';@@ -51,7 +52,7 @@ function DataSourceInfo({if (activeLicense && activeLicense.platform === LicensePlatform.CLOUD) {history.push(ROUTES.GET_STARTED_WITH_CLOUD);} else {- window?.open(DOCS_LINKS.ADD_DATA_SOURCE, '_blank', 'noopener noreferrer');+ openInNewTab(DOCS_LINKS.ADD_DATA_SOURCE);}};diff --git a/frontend/src/container/Home/HomeChecklist/HomeChecklist.tsx b/frontend/src/container/Home/HomeChecklist/HomeChecklist.tsxindex 966d9ef66e..a0bff06b2a 100644--- a/frontend/src/container/Home/HomeChecklist/HomeChecklist.tsx+++ b/frontend/src/container/Home/HomeChecklist/HomeChecklist.tsx@@ -8,6 +8,7 @@ import { ArrowRight, ArrowRightToLine, BookOpenText } from 'lucide-react';import { useAppContext } from 'providers/App/App';import { LicensePlatform } from 'types/api/licensesV3/getActive';import { USER_ROLES } from 'types/roles';+import { openInNewTab } from 'utils/navigation';import './HomeChecklist.styles.scss';@@ -99,11 +100,7 @@ function HomeChecklist({) {history.push(item.toRoute || '');} else {- window?.open(- item.docsLink || '',- '_blank',- 'noopener noreferrer',- );+ openInNewTab(item.docsLink || '');}}}>@@ -119,7 +116,7 @@ function HomeChecklist({step: item.id,});- window?.open(item.docsLink, '_blank', 'noopener noreferrer');+ openInNewTab(item.docsLink ?? '');}}><BookOpenText size={16} />diff --git a/frontend/src/container/Home/Services/ServiceMetrics.tsx b/frontend/src/container/Home/Services/ServiceMetrics.tsxindex 9dfd49af41..7f70c5cfc8 100644--- a/frontend/src/container/Home/Services/ServiceMetrics.tsx+++ b/frontend/src/container/Home/Services/ServiceMetrics.tsx@@ -31,6 +31,7 @@ import { GlobalReducer } from 'types/reducer/globalTime';import { Tags } from 'types/reducer/trace';import { USER_ROLES } from 'types/roles';import { isModifierKeyPressed } from 'utils/app';+import { openInNewTab } from 'utils/navigation';import triangleRulerUrl from '@/assets/Icons/triangle-ruler.svg';@@ -79,11 +80,7 @@ const EmptyState = memo() {history.push(ROUTES.GET_STARTED_WITH_CLOUD);} else {- window?.open(- DOCS_LINKS.ADD_DATA_SOURCE,- '_blank',- 'noopener noreferrer',- );+ openInNewTab(DOCS_LINKS.ADD_DATA_SOURCE);}}}>diff --git a/frontend/src/container/Home/Services/ServiceTraces.tsx b/frontend/src/container/Home/Services/ServiceTraces.tsxindex d46368847a..3ff08b0146 100644--- a/frontend/src/container/Home/Services/ServiceTraces.tsx+++ b/frontend/src/container/Home/Services/ServiceTraces.tsx@@ -17,6 +17,7 @@ import { ServicesList } from 'types/api/metrics/getService';import { GlobalReducer } from 'types/reducer/globalTime';import { USER_ROLES } from 'types/roles';import { isModifierKeyPressed } from 'utils/app';+import { openInNewTab } from 'utils/navigation';import triangleRulerUrl from '@/assets/Icons/triangle-ruler.svg';@@ -133,11 +134,7 @@ export default function ServiceTraces({) {history.push(ROUTES.GET_STARTED_WITH_CLOUD);} else {- window?.open(- DOCS_LINKS.ADD_DATA_SOURCE,- '_blank',- 'noopener noreferrer',- );+ openInNewTab(DOCS_LINKS.ADD_DATA_SOURCE);}}}>diff --git a/frontend/src/container/InfraMonitoringK8s/Base/K8sBaseDetails.tsx b/frontend/src/container/InfraMonitoringK8s/Base/K8sBaseDetails.tsxindex 4d37a6fcc0..ff3ec80f3a 100644--- a/frontend/src/container/InfraMonitoringK8s/Base/K8sBaseDetails.tsx+++ b/frontend/src/container/InfraMonitoringK8s/Base/K8sBaseDetails.tsx@@ -51,6 +51,7 @@ import {LogsAggregatorOperator,TracesAggregatorOperator,} from 'types/common/queryBuilder';+import { openInNewTab } from 'utils/navigation';import { v4 as uuidv4 } from 'uuid';import { filterDuplicateFilters } from '../commonUtils';@@ -569,10 +570,7 @@ function K8sBaseDetails<T>({urlQuery.set('compositeQuery', JSON.stringify(compositeQuery));- window.open(- `${window.location.origin}${ROUTES.LOGS_EXPLORER}?${urlQuery.toString()}`,- '_blank',- );+ openInNewTab(`${ROUTES.LOGS_EXPLORER}?${urlQuery.toString()}`);} else if (selectedView === VIEW_TYPES.TRACES) {const compositeQuery = {...initialQueryState,@@ -591,10 +589,7 @@ function K8sBaseDetails<T>({urlQuery.set('compositeQuery', JSON.stringify(compositeQuery));- window.open(- `${window.location.origin}${ROUTES.TRACES_EXPLORER}?${urlQuery.toString()}`,- '_blank',- );+ openInNewTab(`${ROUTES.TRACES_EXPLORER}?${urlQuery.toString()}`);}};diff --git a/frontend/src/container/Integrations/CloudIntegration/AmazonWebServices/ServiceDashboards/ServiceDashboards.tsx b/frontend/src/container/Integrations/CloudIntegration/AmazonWebServices/ServiceDashboards/ServiceDashboards.tsxindex 708b946d8b..abfeb1b052 100644--- a/frontend/src/container/Integrations/CloudIntegration/AmazonWebServices/ServiceDashboards/ServiceDashboards.tsx+++ b/frontend/src/container/Integrations/CloudIntegration/AmazonWebServices/ServiceDashboards/ServiceDashboards.tsx@@ -4,6 +4,7 @@ import {CloudintegrationtypesServiceDTO,} from 'api/generated/services/sigNoz.schemas';import { useSafeNavigate } from 'hooks/useSafeNavigate';+import { withBasePath } from 'utils/basePath';import './ServiceDashboards.styles.scss';@@ -44,7 +45,11 @@ function ServiceDashboards({return;}if (event.metaKey || event.ctrlKey) {- window.open(dashboardUrl, '_blank', 'noopener,noreferrer');+ window.open(+ withBasePath(dashboardUrl),+ '_blank',+ 'noopener,noreferrer',+ );return;}safeNavigate(dashboardUrl);@@ -54,7 +59,11 @@ function ServiceDashboards({return;}if (event.button === 1) {- window.open(dashboardUrl, '_blank', 'noopener,noreferrer');+ window.open(+ withBasePath(dashboardUrl),+ '_blank',+ 'noopener,noreferrer',+ );}}}onKeyDown={(event): void => {diff --git a/frontend/src/container/ListAlertRules/AlertsEmptyState/AlertInfoCard.tsx b/frontend/src/container/ListAlertRules/AlertsEmptyState/AlertInfoCard.tsxindex 936a9c1268..5a7f00f84e 100644--- a/frontend/src/container/ListAlertRules/AlertsEmptyState/AlertInfoCard.tsx+++ b/frontend/src/container/ListAlertRules/AlertsEmptyState/AlertInfoCard.tsx@@ -1,5 +1,6 @@import { ArrowRightOutlined } from '@ant-design/icons';import { Typography } from 'antd';+import { openInNewTab } from 'utils/navigation';interface AlertInfoCardProps {header: string;@@ -19,7 +20,7 @@ function AlertInfoCard({className="alert-info-card"onClick={(): void => {onClick();- window.open(link, '_blank');+ openInNewTab(link);}}><div className="alert-card-text">diff --git a/frontend/src/container/ListAlertRules/AlertsEmptyState/InfoLinkText.tsx b/frontend/src/container/ListAlertRules/AlertsEmptyState/InfoLinkText.tsxindex 3eb2ad4915..9a95271e1d 100644--- a/frontend/src/container/ListAlertRules/AlertsEmptyState/InfoLinkText.tsx+++ b/frontend/src/container/ListAlertRules/AlertsEmptyState/InfoLinkText.tsx@@ -1,5 +1,6 @@import { ArrowRightOutlined, PlayCircleFilled } from '@ant-design/icons';import { Flex, Typography } from 'antd';+import { openInNewTab } from 'utils/navigation';interface InfoLinkTextProps {infoText: string;@@ -20,7 +21,7 @@ function InfoLinkText({<FlexonClick={(): void => {onClick();- window.open(link, '_blank');+ openInNewTab(link);}}className="info-link-container">diff --git a/frontend/src/container/ListOfDashboard/DashboardsList.tsx b/frontend/src/container/ListOfDashboard/DashboardsList.tsxindex 07f93e3f8b..ce1612cbd2 100644--- a/frontend/src/container/ListOfDashboard/DashboardsList.tsx+++ b/frontend/src/container/ListOfDashboard/DashboardsList.tsx@@ -83,6 +83,8 @@ import {} from 'types/api/dashboard/getAll';import APIError from 'types/api/error';import { isModifierKeyPressed } from 'utils/app';+import { getAbsoluteUrl } from 'utils/basePath';+import { openInNewTab } from 'utils/navigation';import awwSnapUrl from '@/assets/Icons/awwSnap.svg';import dashboardsUrl from '@/assets/Icons/dashboards.svg';@@ -457,7 +459,7 @@ function DashboardsList(): JSX.Element {onClick={(e): void => {e.stopPropagation();e.preventDefault();- window.open(getLink(), '_blank');+ openInNewTab(getLink());}}>Open in New Tab@@ -469,7 +471,7 @@ function DashboardsList(): JSX.Element {onClick={(e): void => {e.stopPropagation();e.preventDefault();- setCopy(`${window.location.origin}${getLink()}`);+ setCopy(getAbsoluteUrl(getLink()));}}>Copy Linkdiff --git a/frontend/src/container/ListOfDashboard/TableComponents/Name.tsx b/frontend/src/container/ListOfDashboard/TableComponents/Name.tsxindex deb64ced11..0319b72b94 100644--- a/frontend/src/container/ListOfDashboard/TableComponents/Name.tsx+++ b/frontend/src/container/ListOfDashboard/TableComponents/Name.tsx@@ -1,6 +1,7 @@import { LockFilled } from '@ant-design/icons';import ROUTES from 'constants/routes';import history from 'lib/history';+import { openInNewTab } from 'utils/navigation';import { Data } from '../DashboardsList';import { TableLinkText } from './styles';@@ -12,7 +13,7 @@ function Name(name: Data['name'], data: Data): JSX.Element {const onClickHandler = (event: React.MouseEvent<HTMLElement>): void => {if (event.metaKey || event.ctrlKey) {- window.open(getLink(), '_blank');+ openInNewTab(getLink());} else {history.push(getLink());}diff --git a/frontend/src/container/LogDetailedView/ContextView/ContextLogRenderer.tsx b/frontend/src/container/LogDetailedView/ContextView/ContextLogRenderer.tsxindex 4fa6a4eaff..000b1219bd 100644--- a/frontend/src/container/LogDetailedView/ContextView/ContextLogRenderer.tsx+++ b/frontend/src/container/LogDetailedView/ContextView/ContextLogRenderer.tsx@@ -17,6 +17,7 @@ import useUrlQuery from 'hooks/useUrlQuery';import { ILog } from 'types/api/logs/log';import { Query, TagFilter } from 'types/api/queryBuilder/queryBuilderData';import { DataSource, StringOperators } from 'types/common/queryBuilder';+import { withBasePath } from 'utils/basePath';import { useContextLogData } from './useContextLogData';@@ -116,7 +117,7 @@ function ContextLogRenderer({);const link = `${ROUTES.LOGS_EXPLORER}?${urlQuery.toString()}`;- window.open(link, '_blank', 'noopener,noreferrer');+ window.open(withBasePath(link), '_blank', 'noopener,noreferrer');},[query, urlQuery],);diff --git a/frontend/src/container/LogDetailedView/TableView.tsx b/frontend/src/container/LogDetailedView/TableView.tsxindex ff89737cd2..c1c4dbeaac 100644--- a/frontend/src/container/LogDetailedView/TableView.tsx+++ b/frontend/src/container/LogDetailedView/TableView.tsx@@ -34,6 +34,7 @@ import { SET_DETAILED_LOG_DATA } from 'types/actions/logs';import { IField } from 'types/api/logs/fields';import { ILog } from 'types/api/logs/log';import { DataTypes } from 'types/api/queryBuilder/queryAutocompleteResponse';+import { openInNewTab } from 'utils/navigation';import { ActionItemProps } from './ActionItem';import FieldRenderer from './FieldRenderer';@@ -191,7 +192,7 @@ function TableView({if (event.ctrlKey || event.metaKey) {// open the trace in new tab- window.open(route, '_blank');+ openInNewTab(route);} else {history.push(route);}diff --git a/frontend/src/container/Login/index.tsx b/frontend/src/container/Login/index.tsxindex 24b9e8efd9..29d4f7c68b 100644--- a/frontend/src/container/Login/index.tsx+++ b/frontend/src/container/Login/index.tsx@@ -60,10 +60,8 @@ function Login(): JSX.Element {const [sessionsContext, setSessionsContext] = useState<SessionsContext>();const [isSubmitting, setIsSubmitting] = useState<boolean>(false);const [sessionsOrgId, setSessionsOrgId] = useState<string>('');- const [- sessionsContextLoading,- setIsLoadingSessionsContext,- ] = useState<boolean>(false);+ const [sessionsContextLoading, setIsLoadingSessionsContext] =+ useState<boolean>(false);const [form] = Form.useForm<FormValues>();const [errorMessage, setErrorMessage] = useState<APIError>();@@ -213,6 +211,7 @@ function Login(): JSX.Element {if (isCallbackAuthN) {const url = form.getFieldValue('url');+ // oxlint-disable-next-line signoz/no-raw-absolute-pathwindow.location.href = url;}} catch (error) {@@ -328,7 +327,6 @@ function Login(): JSX.Element {data-testid="email"requiredplaceholder="e.g. [email protected]"- autoFocusdisabled={versionLoading}className="login-form-input"onPressEnter={onNextHandler}diff --git a/frontend/src/container/LogsExplorerList/TanStackTableView/index.tsx b/frontend/src/container/LogsExplorerList/TanStackTableView/index.tsxindex c565d331d0..4c1fd7c857 100644--- a/frontend/src/container/LogsExplorerList/TanStackTableView/index.tsx+++ b/frontend/src/container/LogsExplorerList/TanStackTableView/index.tsx@@ -34,6 +34,7 @@ import ROUTES from 'constants/routes';import { useActiveLog } from 'hooks/logs/useActiveLog';import { useIsDarkMode } from 'hooks/useDarkMode';import useDragColumns from 'hooks/useDragColumns';+import { getAbsoluteUrl } from 'utils/basePath';import { infinityDefaultStyles } from '../InfinityTableView/config';import { TanStackTableStyled } from '../InfinityTableView/styles';@@ -239,7 +240,7 @@ const TanStackTableView = forwardRef<TableVirtuosoHandle, InfinityTableProps>(urlQuery.delete(QueryParams.activeLogId);urlQuery.delete(QueryParams.relativeTime);urlQuery.set(QueryParams.activeLogId, `"${logId}"`);- const link = `${window.location.origin}${pathname}?${urlQuery.toString()}`;+ const link = getAbsoluteUrl(`${pathname}?${urlQuery.toString()}`);setCopy(link);toast.success('Copied to clipboard', { position: 'top-right' });diff --git a/frontend/src/container/MetricsApplication/utils.ts b/frontend/src/container/MetricsApplication/utils.tsindex 00a93e2e08..5e7fb11247 100644--- a/frontend/src/container/MetricsApplication/utils.ts+++ b/frontend/src/container/MetricsApplication/utils.ts@@ -1,5 +1,6 @@import { QueryParams } from 'constants/query';import ROUTES from 'constants/routes';+import { withBasePath } from 'utils/basePath';import { TopOperationList } from './TopOperationsTable';import { NavigateToTraceProps } from './types';@@ -37,7 +38,7 @@ export const navigateToTrace = ({}=${JSONCompositeQuery}`;if (openInNewTab) {- window.open(newTraceExplorerPath, '_blank');+ window.open(withBasePath(newTraceExplorerPath), '_blank');} else {safeNavigate(newTraceExplorerPath);}diff --git a/frontend/src/container/MetricsExplorer/MetricDetails/DashboardsAndAlertsPopover.tsx b/frontend/src/container/MetricsExplorer/MetricDetails/DashboardsAndAlertsPopover.tsxindex 8695d41606..01ff271ab2 100644--- a/frontend/src/container/MetricsExplorer/MetricDetails/DashboardsAndAlertsPopover.tsx+++ b/frontend/src/container/MetricsExplorer/MetricDetails/DashboardsAndAlertsPopover.tsx@@ -9,6 +9,7 @@ import {import { QueryParams } from 'constants/query';import ROUTES from 'constants/routes';import { Bell, Grid } from 'lucide-react';+import { openInNewTab } from 'utils/navigation';import { pluralize } from 'utils/pluralize';import { DashboardsAndAlertsPopoverProps } from './types';@@ -67,9 +68,8 @@ function DashboardsAndAlertsPopover({<Typography.Linkkey={alert.alertId}onClick={(): void => {- window.open(+ openInNewTab(`${ROUTES.ALERT_OVERVIEW}?${QueryParams.ruleId}=${alert.alertId}`,- '_blank',);}}className="dashboards-popover-content-item"@@ -90,11 +90,10 @@ function DashboardsAndAlertsPopover({<Typography.Linkkey={dashboard.dashboardId}onClick={(): void => {- window.open(+ openInNewTab(generatePath(ROUTES.DASHBOARD, {dashboardId: dashboard.dashboardId,}),- '_blank',);}}className="dashboards-popover-content-item"diff --git a/frontend/src/container/NewWidget/RightContainer/ContextLinks/UpdateContextLinks.tsx b/frontend/src/container/NewWidget/RightContainer/ContextLinks/UpdateContextLinks.tsxindex 5eb25d3159..fd6dede8b7 100644--- a/frontend/src/container/NewWidget/RightContainer/ContextLinks/UpdateContextLinks.tsx+++ b/frontend/src/container/NewWidget/RightContainer/ContextLinks/UpdateContextLinks.tsx@@ -18,6 +18,7 @@ import {import useContextVariables from 'hooks/dashboard/useContextVariables';import { Plus, Trash2 } from 'lucide-react';import { ContextLinkProps, Widgets } from 'types/api/dashboard/getAll';+import { getBaseUrl } from 'utils/basePath';import VariablesDropdown from './VariablesDropdown';@@ -84,7 +85,7 @@ function UpdateContextLinks({);// Function to get current domain- const getCurrentDomain = (): string => window.location.origin;+ const getCurrentDomain = (): string => getBaseUrl();// Function to handle variable selection from dropdownconst handleVariableSelect = (diff --git a/frontend/src/container/NoLogs/NoLogs.tsx b/frontend/src/container/NoLogs/NoLogs.tsxindex f95eddded1..6093f1627f 100644--- a/frontend/src/container/NoLogs/NoLogs.tsx+++ b/frontend/src/container/NoLogs/NoLogs.tsx@@ -6,6 +6,7 @@ import history from 'lib/history';import { ArrowUpRight } from 'lucide-react';import { DataSource } from 'types/common/queryBuilder';import DOCLINKS from 'utils/docLinks';+import { openInNewTab } from 'utils/navigation';import eyesEmojiUrl from '@/assets/Images/eyesEmoji.svg';@@ -42,11 +43,11 @@ export default function NoLogs({}history.push(link);} else if (dataSource === 'traces') {- window.open(DOCLINKS.TRACES_EXPLORER_EMPTY_STATE, '_blank');+ openInNewTab(DOCLINKS.TRACES_EXPLORER_EMPTY_STATE);} else if (dataSource === DataSource.METRICS) {- window.open(DOCLINKS.METRICS_EXPLORER_EMPTY_STATE, '_blank');+ openInNewTab(DOCLINKS.METRICS_EXPLORER_EMPTY_STATE);} else {- window.open(`${DOCLINKS.USER_GUIDE}${dataSource}/`, '_blank');+ openInNewTab(`${DOCLINKS.USER_GUIDE}${dataSource}/`);}};return (diff --git a/frontend/src/container/OnboardingQuestionaire/InviteTeamMembers/InviteTeamMembers.tsx b/frontend/src/container/OnboardingQuestionaire/InviteTeamMembers/InviteTeamMembers.tsxindex f3ef26387c..4da0306de5 100644--- a/frontend/src/container/OnboardingQuestionaire/InviteTeamMembers/InviteTeamMembers.tsx+++ b/frontend/src/container/OnboardingQuestionaire/InviteTeamMembers/InviteTeamMembers.tsx@@ -16,6 +16,7 @@ import {Trash2,} from 'lucide-react';import APIError from 'types/api/error';+import { getBaseUrl } from 'utils/basePath';import { v4 as uuid } from 'uuid';import { OnboardingQuestionHeader } from '../OnboardingQuestionHeader';@@ -58,7 +59,7 @@ function InviteTeamMembers({email: '',role: '',name: '',- frontendBaseUrl: window.location.origin,+ frontendBaseUrl: getBaseUrl(),id: '',};diff --git a/frontend/src/container/OnboardingV2Container/IngestionDetails/IngestionDetails.tsx b/frontend/src/container/OnboardingV2Container/IngestionDetails/IngestionDetails.tsxindex 305affb50f..a17fecc3e4 100644--- a/frontend/src/container/OnboardingV2Container/IngestionDetails/IngestionDetails.tsx+++ b/frontend/src/container/OnboardingV2Container/IngestionDetails/IngestionDetails.tsx@@ -8,6 +8,7 @@ import { DOCS_BASE_URL } from 'constants/app';import { useGetGlobalConfig } from 'hooks/globalConfig/useGetGlobalConfig';import { useNotifications } from 'hooks/useNotifications';import { ArrowUpRight, Copy, Info, Key, TriangleAlert } from 'lucide-react';+import { withBasePath } from 'utils/basePath';import './IngestionDetails.styles.scss';@@ -215,7 +216,7 @@ export default function OnboardingIngestionDetails(): JSX.Element {</a>. To create a new one,{' '}<a- href="/settings/ingestion-settings"+ href={withBasePath('/settings/ingestion-settings')}target="_blank"className="learn-more"rel="noreferrer"diff --git a/frontend/src/container/OnboardingV2Container/InviteTeamMembers/InviteTeamMembers.tsx b/frontend/src/container/OnboardingV2Container/InviteTeamMembers/InviteTeamMembers.tsxindex 735fbbfae1..2c70012c55 100644--- a/frontend/src/container/OnboardingV2Container/InviteTeamMembers/InviteTeamMembers.tsx+++ b/frontend/src/container/OnboardingV2Container/InviteTeamMembers/InviteTeamMembers.tsx@@ -8,6 +8,7 @@ import { useNotifications } from 'hooks/useNotifications';import { cloneDeep, debounce, isEmpty } from 'lodash-es';import { ArrowRight, CheckCircle, Plus, TriangleAlert, X } from 'lucide-react';import APIError from 'types/api/error';+import { getBaseUrl } from 'utils/basePath';import { v4 as uuid } from 'uuid';import './InviteTeamMembers.styles.scss';@@ -56,7 +57,7 @@ function InviteTeamMembers({email: '',role: 'EDITOR',name: '',- frontendBaseUrl: window.location.origin,+ frontendBaseUrl: getBaseUrl(),id: '',};diff --git a/frontend/src/container/OrganizationSettings/AuthDomain/index.tsx b/frontend/src/container/OrganizationSettings/AuthDomain/index.tsxindex 7d5f4e8c32..f1545b61f0 100644--- a/frontend/src/container/OrganizationSettings/AuthDomain/index.tsx+++ b/frontend/src/container/OrganizationSettings/AuthDomain/index.tsx@@ -17,6 +17,7 @@ import ErrorContent from 'components/ErrorModal/components/ErrorContent';import CopyToClipboard from 'periscope/components/CopyToClipboard';import { useErrorModal } from 'providers/ErrorModalProvider';import APIError from 'types/api/error';+import { getAbsoluteUrl } from 'utils/basePath';import CreateEdit from './CreateEdit/CreateEdit';import SSOEnforcementToggle from './SSOEnforcementToggle';@@ -144,7 +145,7 @@ function AuthDomain(): JSX.Element {return <span className="auth-domain-list-na">N/A</span>;}- const href = `${window.location.origin}/${relayPath}`;+ const href = getAbsoluteUrl(`/${relayPath}`);return <CopyToClipboard textToCopy={href} />;},},diff --git a/frontend/src/container/OrganizationSettings/InviteUserModal/InviteUserModal.tsx b/frontend/src/container/OrganizationSettings/InviteUserModal/InviteUserModal.tsxindex e31bc832ad..4644af29d9 100644--- a/frontend/src/container/OrganizationSettings/InviteUserModal/InviteUserModal.tsx+++ b/frontend/src/container/OrganizationSettings/InviteUserModal/InviteUserModal.tsx@@ -4,6 +4,7 @@ import { Button, Form, FormInstance, Modal } from 'antd';import sendInvite from 'api/v1/invite/create';import { useNotifications } from 'hooks/useNotifications';import APIError from 'types/api/error';+import { getBaseUrl } from 'utils/basePath';import InviteTeamMembers from '../InviteTeamMembers';import { InviteMemberFormValues } from '../utils';@@ -40,7 +41,7 @@ function InviteUserModal(props: InviteUserModalProps): JSX.Element {email: member.email,name: member?.name,role: member.role,- frontendBaseUrl: window.location.origin,+ frontendBaseUrl: getBaseUrl(),});notifications.success({diff --git a/frontend/src/container/QueryTable/Drilldown/useBaseAggregateOptions.tsx b/frontend/src/container/QueryTable/Drilldown/useBaseAggregateOptions.tsxindex 709987fcac..e56e954724 100644--- a/frontend/src/container/QueryTable/Drilldown/useBaseAggregateOptions.tsx+++ b/frontend/src/container/QueryTable/Drilldown/useBaseAggregateOptions.tsx@@ -14,6 +14,7 @@ import ContextMenu from 'periscope/components/ContextMenu';import { useDashboardStore } from 'providers/Dashboard/store/useDashboardStore';import { ContextLinksData } from 'types/api/dashboard/getAll';import { Query } from 'types/api/queryBuilder/queryBuilderData';+import { openInNewTab } from 'utils/navigation';import { ContextMenuItem } from './contextConfig';import { getDataLinks } from './dataLinksUtils';@@ -115,7 +116,7 @@ const useBaseAggregateOptions = ({key={id}icon={<LinkOutlined />}onClick={(): void => {- window.open(url, '_blank');+ openInNewTab(url);onClose?.();}}>diff --git a/frontend/src/container/RoutingPolicies/RoutingPolicyDetails.tsx b/frontend/src/container/RoutingPolicies/RoutingPolicyDetails.tsxindex 447f2c5c34..1b203ede4b 100644--- a/frontend/src/container/RoutingPolicies/RoutingPolicyDetails.tsx+++ b/frontend/src/container/RoutingPolicies/RoutingPolicyDetails.tsx@@ -14,6 +14,7 @@ import { ModalTitle } from 'container/PipelinePage/PipelineListsView/styles';import { Check, Loader, X } from 'lucide-react';import { useAppContext } from 'providers/App/App';import { USER_ROLES } from 'types/roles';+import { openInNewTab } from 'utils/navigation';import { INITIAL_ROUTING_POLICY_DETAILS_FORM_STATE } from './constants';import {@@ -76,7 +77,7 @@ function RoutingPolicyDetails({style={{ padding: '0 4px' }}type="link"onClick={(): void => {- window.open(ROUTES.CHANNELS_NEW, '_blank');+ openInNewTab(ROUTES.CHANNELS_NEW);}}>here.diff --git a/frontend/src/container/SideNav/SideNav.tsx b/frontend/src/container/SideNav/SideNav.tsxindex 1b7baabec2..e8d6e0ae72 100644--- a/frontend/src/container/SideNav/SideNav.tsx+++ b/frontend/src/container/SideNav/SideNav.tsx@@ -818,7 +818,7 @@ function SideNav({ isPinned }: { isPinned: boolean }): JSX.Element {);if (item && !('type' in item) && item.isExternal && item.url) {- window.open(item.url, '_blank');+ openInNewTab(item.url);}const event = (info as SidebarItem & { domEvent?: MouseEvent }).domEvent;diff --git a/frontend/src/container/SpanDetailsDrawer/SpanLogs/SpanLogs.tsx b/frontend/src/container/SpanDetailsDrawer/SpanLogs/SpanLogs.tsxindex ed5950433f..1eb750ff68 100644--- a/frontend/src/container/SpanDetailsDrawer/SpanLogs/SpanLogs.tsx+++ b/frontend/src/container/SpanDetailsDrawer/SpanLogs/SpanLogs.tsx@@ -28,6 +28,7 @@ import {} from 'types/api/queryBuilder/queryAutocompleteResponse';import { TagFilter } from 'types/api/queryBuilder/queryBuilderData';import { DataSource } from 'types/common/queryBuilder';+import { openInNewTab } from 'utils/navigation';import { v4 as uuid } from 'uuid';import noDataUrl from '@/assets/Icons/no-data.svg';@@ -143,7 +144,7 @@ function SpanLogs({const url = `${ROUTES.LOGS_EXPLORER}?${createQueryParams(queryParams)}`;- window.open(url, '_blank');+ openInNewTab(url);},[isLogSpanRelated,diff --git a/frontend/src/container/SpanDetailsDrawer/SpanRelatedSignals/SpanRelatedSignals.tsx b/frontend/src/container/SpanDetailsDrawer/SpanRelatedSignals/SpanRelatedSignals.tsxindex 91c1f51d82..6cd32b6814 100644--- a/frontend/src/container/SpanDetailsDrawer/SpanRelatedSignals/SpanRelatedSignals.tsx+++ b/frontend/src/container/SpanDetailsDrawer/SpanRelatedSignals/SpanRelatedSignals.tsx@@ -17,6 +17,7 @@ import { BarChart2, Compass, X } from 'lucide-react';import { BaseAutocompleteData } from 'types/api/queryBuilder/queryAutocompleteResponse';import { Span } from 'types/api/trace/getTraceV2';import { DataSource, LogsAggregatorOperator } from 'types/common/queryBuilder';+import { getAbsoluteUrl } from 'utils/basePath';import { RelatedSignalsViews } from '../constants';import SpanLogs from '../SpanLogs/SpanLogs';@@ -158,9 +159,7 @@ function SpanRelatedSignals({searchParams.set(QueryParams.endTime, endTimeMs.toString());window.open(- `${window.location.origin}${- ROUTES.LOGS_EXPLORER- }?${searchParams.toString()}`,+ getAbsoluteUrl(`${ROUTES.LOGS_EXPLORER}?${searchParams.toString()}`),'_blank','noopener,noreferrer',);diff --git a/frontend/src/container/Trace/TraceTable/index.tsx b/frontend/src/container/Trace/TraceTable/index.tsxindex af9bc1753a..66b3d37889 100644--- a/frontend/src/container/Trace/TraceTable/index.tsx+++ b/frontend/src/container/Trace/TraceTable/index.tsx@@ -31,6 +31,7 @@ import {UPDATE_SPANS_AGGREGATE_PAGE_SIZE,} from 'types/actions/trace';import { TraceReducer } from 'types/reducer/trace';+import { openInNewTab } from 'utils/navigation';import { v4 } from 'uuid';dayjs.extend(duration);@@ -214,7 +215,7 @@ function TraceTable(): JSX.Element {event.preventDefault();event.stopPropagation();if (event.metaKey || event.ctrlKey) {- window.open(getLink(record), '_blank');+ openInNewTab(getLink(record));} else {history.push(getLink(record));}diff --git a/frontend/src/container/TracesTableComponent/TracesTableComponent.tsx b/frontend/src/container/TracesTableComponent/TracesTableComponent.tsxindex 9feab055e6..c1ad82c600 100644--- a/frontend/src/container/TracesTableComponent/TracesTableComponent.tsx+++ b/frontend/src/container/TracesTableComponent/TracesTableComponent.tsx@@ -28,6 +28,7 @@ import { useTimezone } from 'providers/Timezone';import { SuccessResponse } from 'types/api';import { Widgets } from 'types/api/dashboard/getAll';import { MetricRangePayloadProps } from 'types/api/metrics/getQueryRange';+import { openInNewTab } from 'utils/navigation';import './TracesTableComponent.styles.scss';@@ -86,7 +87,7 @@ function TracesTableComponent({event.preventDefault();event.stopPropagation();if (event.metaKey || event.ctrlKey) {- window.open(getTraceLink(record), '_blank');+ openInNewTab(getTraceLink(record));} else {history.push(getTraceLink(record));}diff --git a/frontend/src/hooks/integration/aws/useIntegrationModal.ts b/frontend/src/hooks/integration/aws/useIntegrationModal.tsindex fb9c01bc8c..72a400aaaf 100644--- a/frontend/src/hooks/integration/aws/useIntegrationModal.ts+++ b/frontend/src/hooks/integration/aws/useIntegrationModal.ts@@ -72,7 +72,7 @@ export function useIntegrationModal({ModalStateEnum.FORM,);const [isLoading, setIsLoading] = useState(false);- const [accountId, setAccountId] = useState<string | undefined>(undefined);+ const [accountId, setAccountId] = useState<string | undefined>();const [activeView, setActiveView] = useState<ActiveViewEnum>(ActiveViewEnum.FORM,);@@ -80,7 +80,7 @@ export function useIntegrationModal({const [includeAllRegions, setIncludeAllRegions] = useState(false);const [selectedDeploymentRegion, setSelectedDeploymentRegion] = useState<string | undefined- >(undefined);+ >();const allRegions = useMemo(() => regions.flatMap((r) => r.subRegions.map((sr) => sr.name)),[],@@ -108,7 +108,7 @@ export function useIntegrationModal({const handleConnectionSuccess = useCallback((payload: { cloudAccountId: string; status?: unknown }): void => {- logEvent('AWS Integration: Account connected', {+ void logEvent('AWS Integration: Account connected', {cloudAccountId: payload.cloudAccountId,status: payload.status,});@@ -126,7 +126,7 @@ export function useIntegrationModal({const handleConnectionTimeout = useCallback((payload: { id?: string }): void => {setModalState(ModalStateEnum.ERROR);- logEvent('AWS Integration: Account connection attempt timed out', {+ void logEvent('AWS Integration: Account connection attempt timed out', {id: payload.id,});},@@ -140,19 +140,17 @@ export function useIntegrationModal({const { mutate: generateUrl, isLoading: isGeneratingUrl } = useCreateAccount();const handleError = useAxiosError();- const {- data: connectionParams,- isLoading: isConnectionParamsLoading,- } = useGetConnectionCredentials<GetConnectionCredentialsQueryResult>(- {- cloudProvider: INTEGRATION_TYPES.AWS,- },- {- query: {- onError: handleError,+ const { data: connectionParams, isLoading: isConnectionParamsLoading } =+ useGetConnectionCredentials<GetConnectionCredentialsQueryResult>(+ {+ cloudProvider: INTEGRATION_TYPES.AWS,},- },- );+ {+ query: {+ onError: handleError,+ },+ },+ );const handleGenerateUrl = useCallback((payload: CloudintegrationtypesPostableAccountDTO): void => {@@ -167,12 +165,13 @@ export function useIntegrationModal({const connectionUrl =response.data.connectionArtifact.aws?.connectionUrl ?? '';- logEvent(+ void logEvent('AWS Integration: Account connection attempt redirected to AWS',{id: accountId,},);+ // oxlint-disable-next-line signoz/no-raw-absolute-path -- connectionUrl is an external AWS console URL, not an internal pathwindow.open(connectionUrl, '_blank');setModalState(ModalStateEnum.WAITING);setAccountId(accountId);diff --git a/frontend/src/hooks/logs/useCopyLogLink.ts b/frontend/src/hooks/logs/useCopyLogLink.tsindex e7147a79c3..6602060179 100644--- a/frontend/src/hooks/logs/useCopyLogLink.ts+++ b/frontend/src/hooks/logs/useCopyLogLink.ts@@ -17,6 +17,7 @@ import useUrlQuery from 'hooks/useUrlQuery';import useUrlQueryData from 'hooks/useUrlQueryData';import { AppState } from 'store/reducers';import { GlobalReducer } from 'types/reducer/globalTime';+import { getAbsoluteUrl } from 'utils/basePath';import { HIGHLIGHTED_DELAY } from './configs';import { UseCopyLogLink } from './types';@@ -60,7 +61,7 @@ export const useCopyLogLink = (logId?: string): UseCopyLogLink => {urlQuery.set(QueryParams.startTime, minTime?.toString() || '');urlQuery.set(QueryParams.endTime, maxTime?.toString() || '');- const link = `${window.location.origin}${pathname}?${urlQuery.toString()}`;+ const link = getAbsoluteUrl(`${pathname}?${urlQuery.toString()}`);setCopy(link);diff --git a/frontend/src/hooks/queryBuilder/useCreateAlerts.tsx b/frontend/src/hooks/queryBuilder/useCreateAlerts.tsxindex 314e0d1c56..98c4ce2994 100644--- a/frontend/src/hooks/queryBuilder/useCreateAlerts.tsx+++ b/frontend/src/hooks/queryBuilder/useCreateAlerts.tsx@@ -21,6 +21,7 @@ import { useDashboardStore } from 'providers/Dashboard/store/useDashboardStore';import { AppState } from 'store/reducers';import { Widgets } from 'types/api/dashboard/getAll';import { GlobalReducer } from 'types/reducer/globalTime';+import { withBasePath } from 'utils/basePath';import { getGraphType } from 'utils/getGraphType';const useCreateAlerts = (widget?: Widgets, caller?: string): VoidFunction => {@@ -95,7 +96,7 @@ const useCreateAlerts = (widget?: Widgets, caller?: string): VoidFunction => {const url = `${ROUTES.ALERTS_NEW}?${params.toString()}`;- window.open(url, '_blank', 'noreferrer');+ window.open(withBasePath(url), '_blank', 'noreferrer');},onError: () => {notifications.error({diff --git a/frontend/src/hooks/trace/useCopySpanLink.ts b/frontend/src/hooks/trace/useCopySpanLink.tsindex cb5d01c11c..390f55152f 100644--- a/frontend/src/hooks/trace/useCopySpanLink.ts+++ b/frontend/src/hooks/trace/useCopySpanLink.ts@@ -4,6 +4,7 @@ import { useCopyToClipboard } from 'react-use';import { useNotifications } from 'hooks/useNotifications';import useUrlQuery from 'hooks/useUrlQuery';import { Span } from 'types/api/trace/getTraceV2';+import { getAbsoluteUrl } from 'utils/basePath';export const useCopySpanLink = (span?: Span,@@ -28,7 +29,7 @@ export const useCopySpanLink = (urlQuery.set('spanId', span?.spanId);}- const link = `${window.location.origin}${pathname}?${urlQuery.toString()}`;+ const link = getAbsoluteUrl(`${pathname}?${urlQuery.toString()}`);setCopy(link);notifications.success({diff --git a/frontend/src/hooks/useSafeNavigate.ts b/frontend/src/hooks/useSafeNavigate.tsindex ecdeeb3a9e..ed68979efe 100644--- a/frontend/src/hooks/useSafeNavigate.ts+++ b/frontend/src/hooks/useSafeNavigate.ts@@ -26,12 +26,9 @@ const areUrlsEffectivelySame = (url1: URL, url2: URL): boolean => {const params1 = new URLSearchParams(url1.search);const params2 = new URLSearchParams(url2.search);- const allParams = new Set([- ...Array.from(params1.keys()),- ...Array.from(params2.keys()),- ]);+ const allParams = new Set([...params1.keys(), ...params2.keys()]);- return Array.from(allParams).every((param) => {+ return [...allParams].every((param) => {if (param === 'compositeQuery') {try {const query1 = params1.get('compositeQuery');@@ -84,11 +81,11 @@ const isDefaultNavigation = (currentUrl: URL, targetUrl: URL): boolean => {}// Case 2: Check for new params that didn't exist before- const currentKeys = new Set(Array.from(currentParams.keys()));- const targetKeys = new Set(Array.from(targetParams.keys()));+ const currentKeys = new Set(currentParams.keys());+ const targetKeys = new Set(targetParams.keys());// Find keys that exist in target but not in current- const newKeys = Array.from(targetKeys).filter((key) => !currentKeys.has(key));+ const newKeys = [...targetKeys].filter((key) => !currentKeys.has(key));return newKeys.length > 0;};@@ -108,19 +105,18 @@ export const useSafeNavigate = (const safeNavigate = useCallback(// eslint-disable-next-line sonarjs/cognitive-complexity(to: string | SafeNavigateParams, options?: NavigateOptions) => {- const currentUrl = new URL(- `${location.pathname}${location.search}`,- window.location.origin,- );+ // oxlint-disable-next-line signoz/no-raw-absolute-path+ const base = window.location.origin;+ const currentUrl = new URL(`${location.pathname}${location.search}`, base);let targetUrl: URL;if (typeof to === 'string') {- targetUrl = new URL(to, window.location.origin);+ targetUrl = new URL(to, base);} else {targetUrl = new URL(`${to.pathname || location.pathname}${to.search || ''}`,- window.location.origin,+ base,);}diff --git a/frontend/src/pages/MessagingQueues/MQDetails/DropRateView/DropRateView.tsx b/frontend/src/pages/MessagingQueues/MQDetails/DropRateView/DropRateView.tsxindex 92f4770093..f5e4910836 100644--- a/frontend/src/pages/MessagingQueues/MQDetails/DropRateView/DropRateView.tsx+++ b/frontend/src/pages/MessagingQueues/MQDetails/DropRateView/DropRateView.tsx@@ -19,6 +19,7 @@ import {} from 'pages/MessagingQueues/MessagingQueuesUtils';import { AppState } from 'store/reducers';import { GlobalReducer } from 'types/reducer/globalTime';+import { openInNewTab } from 'utils/navigation';import {convertToMilliseconds,@@ -93,7 +94,7 @@ export function getColumns(key={item}className="traceid-text"onClick={(): void => {- window.open(`${ROUTES.TRACE}/${item}`, '_blank');+ openInNewTab(`${ROUTES.TRACE}/${item}`);logEvent(`MQ Kafka: Drop Rate - traceid navigation`, {item,});@@ -123,7 +124,7 @@ export function getColumns(onClick={(e): void => {e.preventDefault();e.stopPropagation();- window.open(`/services/${encodeURIComponent(text)}`, '_blank');+ openInNewTab(`/services/${encodeURIComponent(text)}`);}}>{text}diff --git a/frontend/src/pages/MessagingQueues/MessagingQueues.tsx b/frontend/src/pages/MessagingQueues/MessagingQueues.tsxindex 74750bfcfb..82f3865cf3 100644--- a/frontend/src/pages/MessagingQueues/MessagingQueues.tsx+++ b/frontend/src/pages/MessagingQueues/MessagingQueues.tsx@@ -59,7 +59,7 @@ function MessagingQueues(): JSX.Element {history.push(link);}} else {- window.open(KAFKA_SETUP_DOC_LINK, '_blank');+ openInNewTab(KAFKA_SETUP_DOC_LINK);}};diff --git a/frontend/src/pages/Support/Support.tsx b/frontend/src/pages/Support/Support.tsxindex 9bc6df35d7..80d1c7c4a2 100644--- a/frontend/src/pages/Support/Support.tsx+++ b/frontend/src/pages/Support/Support.tsx@@ -20,6 +20,8 @@ import { useAppContext } from 'providers/App/App';import { SuccessResponseV2 } from 'types/api';import { CheckoutSuccessPayloadProps } from 'types/api/billing/checkout';import APIError from 'types/api/error';+import { getBaseUrl } from 'utils/basePath';+import { openInNewTab } from 'utils/navigation';import './Support.styles.scss';@@ -92,7 +94,7 @@ export default function Support(): JSX.Element {const { pathname } = useLocation();const handleChannelWithRedirects = (url: string): void => {- window.open(url, '_blank');+ openInNewTab(url);};useEffect(() => {@@ -150,7 +152,7 @@ export default function Support(): JSX.Element {});updateCreditCard({- url: window.location.origin,+ url: getBaseUrl(),});};diff --git a/frontend/src/pages/WorkspaceLocked/WorkspaceLocked.tsx b/frontend/src/pages/WorkspaceLocked/WorkspaceLocked.tsxindex 7ee0f08b07..6ab1162115 100644--- a/frontend/src/pages/WorkspaceLocked/WorkspaceLocked.tsx+++ b/frontend/src/pages/WorkspaceLocked/WorkspaceLocked.tsx@@ -29,6 +29,7 @@ import { useAppContext } from 'providers/App/App';import APIError from 'types/api/error';import { LicensePlatform } from 'types/api/licensesV3/getActive';import { isModifierKeyPressed } from 'utils/app';+import { getBaseUrl } from 'utils/basePath';import { getFormattedDate } from 'utils/timeUtils';import CustomerStoryCard from './CustomerStoryCard';@@ -115,7 +116,7 @@ export default function WorkspaceBlocked(): JSX.Element {logEvent('Workspace Blocked: User Clicked Update Credit Card', {});updateCreditCard({- url: window.location.origin,+ url: getBaseUrl(),});}, [updateCreditCard]);diff --git a/frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.tsx b/frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.tsxindex 9882e10ac2..cb68a5f14c 100644--- a/frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.tsx+++ b/frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.tsx@@ -21,6 +21,7 @@ import history from 'lib/history';import { useAppContext } from 'providers/App/App';import APIError from 'types/api/error';import { LicensePlatform, LicenseState } from 'types/api/licensesV3/getActive';+import { getBaseUrl } from 'utils/basePath';import { getFormattedDateWithMinutes } from 'utils/timeUtils';import featureGraphicCorrelationUrl from '@/assets/Images/feature-graphic-correlation.svg';@@ -57,7 +58,7 @@ function WorkspaceSuspended(): JSX.Element {const handleUpdateCreditCard = useCallback(async () => {manageCreditCard({- url: window.location.origin,+ url: getBaseUrl(),});}, [manageCreditCard]);diff --git a/frontend/src/providers/EventSource.tsx b/frontend/src/providers/EventSource.tsxindex 6da32d367c..497a762808 100644--- a/frontend/src/providers/EventSource.tsx+++ b/frontend/src/providers/EventSource.tsx@@ -22,6 +22,7 @@ import { LOCALSTORAGE } from 'constants/localStorage';import { EventListener, EventSourcePolyfill } from 'event-source-polyfill';import { useNotifications } from 'hooks/useNotifications';import APIError from 'types/api/error';+import { withBasePath } from 'utils/basePath';interface IEventSourceContext {eventSourceInstance: EventSourcePolyfill | null;@@ -129,9 +130,12 @@ export function EventSourceProvider({const handleStartOpenConnection = useCallback((filterExpression?: string): void => {- const eventSourceUrl = `${- ENVIRONMENT.baseURL- }${apiV3}logs/livetail?filter=${encodeURIComponent(filterExpression || '')}`;+ const apiPath = `${apiV3}logs/livetail?filter=${encodeURIComponent(+ filterExpression || '',+ )}`;+ const eventSourceUrl = ENVIRONMENT.baseURL+ ? `${ENVIRONMENT.baseURL}${apiPath}`+ : withBasePath(apiPath);eventSourceRef.current = new EventSourcePolyfill(eventSourceUrl, {headers: {diff --git a/frontend/src/utils/basePath.ts b/frontend/src/utils/basePath.tsindex 78a4e0b91d..0cc8b30716 100644--- a/frontend/src/utils/basePath.ts+++ b/frontend/src/utils/basePath.ts@@ -35,6 +35,7 @@ export function withBasePath(path: string): string {* getAbsoluteUrl(ROUTES.LOGS_EXPLORER) → 'https://host/signoz/logs/logs-explorer'*/export function getAbsoluteUrl(path: string): string {+ // oxlint-disable-next-line signoz/no-raw-absolute-pathreturn window.location.origin + withBasePath(path);}@@ -44,7 +45,7 @@ export function getAbsoluteUrl(path: string): string {* getBaseUrl() → 'https://host/signoz'*/export function getBaseUrl(): string {- return (- window.location.origin + (_basePath === '/' ? '' : _basePath.slice(0, -1))- );+ // oxlint-disable-next-line signoz/no-raw-absolute-path+ const origin = window.location.origin;+ return origin + (_basePath === '/' ? '' : _basePath.slice(0, -1));}