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.

Revert "chore: fix regex issue (#8393)" (#8418)

Amlan Kumar Nandy4940dfd46fa4
diff --git a/frontend/src/components/RouteTab/index.tsx b/frontend/src/components/RouteTab/index.tsx
index f47124bb64..be717c26aa 100644
--- a/frontend/src/components/RouteTab/index.tsx
+++ b/frontend/src/components/RouteTab/index.tsx
@@ -1,5 +1,4 @@
import { Tabs, TabsProps } from 'antd';
-import { escapeRegExp } from 'lodash-es';
import { useLocation, useParams } from 'react-router-dom';
import { RouteTabProps } from './types';
@@ -29,11 +28,7 @@ function RouteTab({
// Find the matching route for the current pathname
const currentRoute = routesWithParams.find((route) => {
- const pathnameOnly = route.route.split('?')[0];
- const routePattern = escapeRegExp(pathnameOnly).replace(
- /\\:([a-zA-Z0-9_]+)/g,
- '([^/]+)',
- );
+ const routePattern = route.route.replace(/:(\w+)/g, '([^/]+)');
const regex = new RegExp(`^${routePattern}$`);
return regex.test(location.pathname);
});