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.

10.1 KB
Raw Blame
import { RouteProps } from 'react-router-dom';
import ROUTES from 'constants/routes';

import {
	AIAssistantPage,
	AlertHistory,
	AlertOverview,
	AllErrors,
	ApiMonitoring,
	ChannelsEdit,
	ChannelsNew,
	CreateNewAlerts,
	DashboardPage,
	DashboardPanelEditorPage,
	DashboardsListPage,
	EditRulesPage,
	ErrorDetails,
	ForgotPassword,
	Home,
	InfrastructureMonitoring,
	Integrations,
	IntegrationsDetailsPage,
	LicensePage,
	ListAllALertsPage,
	LLMObservabilityPage,
	Login,
	Logs,
	LogsIndexToFields,
	MessagingQueuesMainPage,
	MeterExplorerPage,
	MetricsExplorer,
	OnboardingV2,
	OrgOnboarding,
	PasswordReset,
	PipelinePage,
	PublicDashboardPage,
	ServiceMapPage,
	ServiceMetricsPage,
	ServicesTablePage,
	ServiceTopLevelOperationsPage,
	SettingsPage,
	SignupPage,
	SomethingWentWrong,
	StatusPage,
	SupportPage,
	TraceDetailV3,
	TracesExplorer,
	TracesFunnelDetails,
	TracesFunnels,
	UnAuthorized,
	UsageExplorerPage,
	WorkspaceAccessRestricted,
	WorkspaceBlocked,
	WorkspaceSuspended,
} from './pageComponents';

const routes: AppRoutes[] = [
	{
		component: SignupPage,
		path: ROUTES.SIGN_UP,
		exact: true,
		isPrivate: false,
		key: 'SIGN_UP',
	},
	{
		path: ROUTES.GET_STARTED_WITH_CLOUD,
		exact: false,
		component: OnboardingV2,
		isPrivate: true,
		key: 'GET_STARTED_WITH_CLOUD',
	},
	{
		path: ROUTES.HOME,
		exact: true,
		component: Home,
		isPrivate: true,
		key: 'HOME',
	},
	{
		path: ROUTES.ONBOARDING,
		exact: false,
		component: OrgOnboarding,
		isPrivate: true,
		key: 'ONBOARDING',
	},
	{
		component: LogsIndexToFields,
		path: ROUTES.LOGS_INDEX_FIELDS,
		exact: true,
		isPrivate: true,
		key: 'LOGS_INDEX_FIELDS',
	},
	{
		component: ServicesTablePage,
		path: ROUTES.APPLICATION,
		exact: true,
		isPrivate: true,
		key: 'APPLICATION',
	},
	{
		path: ROUTES.SERVICE_METRICS,
		exact: true,
		component: ServiceMetricsPage,
		isPrivate: true,
		key: 'SERVICE_METRICS',
	},
	{
		path: ROUTES.SERVICE_TOP_LEVEL_OPERATIONS,
		exact: true,
		component: ServiceTopLevelOperationsPage,
		isPrivate: true,
		key: 'SERVICE_TOP_LEVEL_OPERATIONS',
	},
	{
		path: ROUTES.SERVICE_MAP,
		component: ServiceMapPage,
		isPrivate: true,
		exact: true,
		key: 'SERVICE_MAP',
	},
	{
		path: ROUTES.TRACE_DETAIL,
		exact: true,
		component: TraceDetailV3,
		isPrivate: true,
		key: 'TRACE_DETAIL',
	},
	{
		path: ROUTES.SETTINGS,
		exact: false,
		component: SettingsPage,
		isPrivate: true,
		key: 'SETTINGS',
	},
	{
		path: ROUTES.USAGE_EXPLORER,
		exact: true,
		component: UsageExplorerPage,
		isPrivate: true,
		key: 'USAGE_EXPLORER',
	},
	{
		path: ROUTES.ALL_DASHBOARD,
		exact: true,
		component: DashboardsListPage,
		isPrivate: true,
		key: 'ALL_DASHBOARD',
	},
	{
		path: ROUTES.DASHBOARD,
		exact: true,
		component: DashboardPage,
		isPrivate: true,
		key: 'DASHBOARD',
	},
	{
		path: ROUTES.PUBLIC_DASHBOARD,
		exact: false,
		component: PublicDashboardPage,
		isPrivate: false,
		key: 'PUBLIC_DASHBOARD',
	},
	{
		path: ROUTES.DASHBOARD_PANEL_EDITOR,
		exact: true,
		component: DashboardPanelEditorPage,
		isPrivate: true,
		key: 'DASHBOARD_PANEL_EDITOR',
	},
	{
		path: ROUTES.EDIT_ALERTS,
		exact: true,
		component: EditRulesPage,
		isPrivate: true,
		key: 'EDIT_ALERTS',
	},
	{
		path: ROUTES.LIST_ALL_ALERT,
		exact: true,
		component: ListAllALertsPage,
		isPrivate: true,
		key: 'LIST_ALL_ALERT',
	},
	{
		path: ROUTES.ALERTS_NEW,
		exact: true,
		component: CreateNewAlerts,
		isPrivate: true,
		key: 'ALERTS_NEW',
	},
	{
		path: ROUTES.ALERT_HISTORY,
		exact: true,
		component: AlertHistory,
		isPrivate: true,
		key: 'ALERT_HISTORY',
	},
	{
		path: ROUTES.ALERT_OVERVIEW,
		exact: true,
		component: AlertOverview,
		isPrivate: true,
		key: 'ALERT_OVERVIEW',
	},
	{
		path: ROUTES.TRACES_EXPLORER,
		exact: true,
		component: TracesExplorer,
		isPrivate: true,
		key: 'TRACES_EXPLORER',
	},
	{
		path: ROUTES.TRACES_FUNNELS,
		exact: true,
		component: TracesFunnels,
		isPrivate: true,
		key: 'TRACES_FUNNELS',
	},
	{
		path: ROUTES.TRACES_FUNNELS_DETAIL,
		exact: true,
		component: TracesFunnelDetails,
		isPrivate: true,
		key: 'TRACES_FUNNELS_DETAIL',
	},
	{
		path: ROUTES.CHANNELS_NEW,
		exact: true,
		component: ChannelsNew,
		isPrivate: true,
		key: 'CHANNELS_NEW',
	},
	{
		path: ROUTES.CHANNELS_EDIT,
		exact: true,
		component: ChannelsEdit,
		isPrivate: true,
		key: 'CHANNELS_EDIT',
	},
	{
		path: ROUTES.ALL_ERROR,
		exact: true,
		isPrivate: true,
		component: AllErrors,
		key: 'ALL_ERROR',
	},
	{
		path: ROUTES.ERROR_DETAIL,
		exact: true,
		component: ErrorDetails,
		isPrivate: true,
		key: 'ERROR_DETAIL',
	},
	{
		path: ROUTES.VERSION,
		exact: true,
		component: StatusPage,
		isPrivate: true,
		key: 'VERSION',
	},
	{
		path: ROUTES.LOGS,
		exact: true,
		component: Logs,
		key: 'LOGS',
		isPrivate: true,
	},
	{
		path: ROUTES.LOGS_PIPELINES,
		exact: true,
		component: PipelinePage,
		key: 'LOGS_PIPELINES',
		isPrivate: true,
	},
	{
		path: ROUTES.LOGIN,
		exact: true,
		component: Login,
		isPrivate: false,
		key: 'LOGIN',
	},
	{
		path: ROUTES.FORGOT_PASSWORD,
		exact: true,
		component: ForgotPassword,
		isPrivate: false,
		key: 'FORGOT_PASSWORD',
	},
	{
		path: ROUTES.UN_AUTHORIZED,
		exact: true,
		component: UnAuthorized,
		key: 'UN_AUTHORIZED',
		isPrivate: true,
	},
	{
		path: ROUTES.PASSWORD_RESET,
		exact: true,
		component: PasswordReset,
		key: 'PASSWORD_RESET',
		isPrivate: false,
	},
	{
		path: ROUTES.SOMETHING_WENT_WRONG,
		exact: true,
		component: SomethingWentWrong,
		key: 'SOMETHING_WENT_WRONG',
		isPrivate: false,
	},
	{
		path: ROUTES.WORKSPACE_LOCKED,
		exact: true,
		component: WorkspaceBlocked,
		isPrivate: true,
		key: 'WORKSPACE_LOCKED',
	},
	{
		path: ROUTES.WORKSPACE_SUSPENDED,
		exact: true,
		component: WorkspaceSuspended,
		isPrivate: true,
		key: 'WORKSPACE_SUSPENDED',
	},
	{
		path: ROUTES.WORKSPACE_ACCESS_RESTRICTED,
		exact: true,
		component: WorkspaceAccessRestricted,
		isPrivate: true,
		key: 'WORKSPACE_ACCESS_RESTRICTED',
	},
	{
		path: ROUTES.INTEGRATIONS_DETAIL,
		exact: true,
		component: IntegrationsDetailsPage,
		isPrivate: true,
		key: 'INTEGRATIONS_DETAIL',
	},
	{
		path: ROUTES.INTEGRATIONS,
		exact: true,
		component: Integrations,
		isPrivate: true,
		key: 'INTEGRATIONS',
	},
	{
		path: ROUTES.MESSAGING_QUEUES_KAFKA,
		exact: true,
		component: MessagingQueuesMainPage,
		key: 'MESSAGING_QUEUES_KAFKA',
		isPrivate: true,
	},
	{
		path: ROUTES.MESSAGING_QUEUES_CELERY_TASK,
		exact: true,
		component: MessagingQueuesMainPage,
		key: 'MESSAGING_QUEUES_CELERY_TASK',
		isPrivate: true,
	},
	{
		path: ROUTES.MESSAGING_QUEUES_OVERVIEW,
		exact: true,
		component: MessagingQueuesMainPage,
		key: 'MESSAGING_QUEUES_OVERVIEW',
		isPrivate: true,
	},
	{
		path: ROUTES.MESSAGING_QUEUES_KAFKA_DETAIL,
		exact: true,
		component: MessagingQueuesMainPage,
		key: 'MESSAGING_QUEUES_KAFKA_DETAIL',
		isPrivate: true,
	},
	{
		path: ROUTES.INFRASTRUCTURE_MONITORING_HOSTS,
		exact: true,
		component: InfrastructureMonitoring,
		key: 'INFRASTRUCTURE_MONITORING_HOSTS',
		isPrivate: true,
	},
	{
		path: ROUTES.INFRASTRUCTURE_MONITORING_KUBERNETES,
		exact: true,
		component: InfrastructureMonitoring,
		key: 'INFRASTRUCTURE_MONITORING_KUBERNETES',
		isPrivate: true,
	},
	{
		path: ROUTES.METRICS_EXPLORER,
		exact: true,
		component: MetricsExplorer,
		key: 'METRICS_EXPLORER',
		isPrivate: true,
	},
	{
		path: ROUTES.METRICS_EXPLORER_EXPLORER,
		exact: true,
		component: MetricsExplorer,
		key: 'METRICS_EXPLORER_EXPLORER',
		isPrivate: true,
	},
	{
		path: ROUTES.METRICS_EXPLORER_VOLUME_CONTROL,
		exact: true,
		component: MetricsExplorer,
		key: 'METRICS_EXPLORER_VOLUME_CONTROL',
		isPrivate: true,
	},

	{
		path: ROUTES.METER,
		exact: true,
		component: MeterExplorerPage,
		key: 'METER',
		isPrivate: true,
	},
	{
		path: ROUTES.METER_EXPLORER,
		exact: true,
		component: MeterExplorerPage,
		key: 'METER_EXPLORER',
		isPrivate: true,
	},
	{
		path: ROUTES.API_MONITORING,
		exact: true,
		component: ApiMonitoring,
		key: 'API_MONITORING',
		isPrivate: true,
	},
	{
		path: [ROUTES.AI_ASSISTANT_BASE, ROUTES.AI_ASSISTANT],
		exact: true,
		component: AIAssistantPage,
		key: 'AI_ASSISTANT',
		isPrivate: true,
	},
	{
		path: ROUTES.AI_OBSERVABILITY_ATTRIBUTE_MAPPING,
		exact: true,
		component: LLMObservabilityPage,
		key: 'AI_OBSERVABILITY_ATTRIBUTE_MAPPING',
		isPrivate: true,
	},
	{
		path: ROUTES.AI_OBSERVABILITY_OVERVIEW,
		exact: true,
		component: LLMObservabilityPage,
		key: 'AI_OBSERVABILITY_OVERVIEW',
		isPrivate: true,
	},
	{
		path: ROUTES.AI_OBSERVABILITY_EXPLORER,
		exact: true,
		component: LLMObservabilityPage,
		key: 'AI_OBSERVABILITY_EXPLORER',
		isPrivate: true,
	},
	{
		path: ROUTES.AI_OBSERVABILITY_CONFIGURATION,
		exact: true,
		component: LLMObservabilityPage,
		key: 'AI_OBSERVABILITY_CONFIGURATION',
		isPrivate: true,
	},
];

export const SUPPORT_ROUTE: AppRoutes = {
	path: ROUTES.SUPPORT,
	exact: true,
	component: SupportPage,
	key: 'SUPPORT',
	isPrivate: true,
};

export const LIST_LICENSES: AppRoutes = {
	path: ROUTES.LIST_LICENSES,
	exact: true,
	component: LicensePage,
	isPrivate: true,
	key: 'LIST_LICENSES',
};

export const oldNewRoutesMapping: Record<string, string> = {
	'/pipelines': '/logs/pipelines',
	'/logs-explorer': '/logs/logs-explorer',
	'/logs-save-views': '/logs/logs-explorer',
	'/traces-save-views': '/traces-explorer',
	'/logs/saved-views': '/logs/logs-explorer',
	'/traces/saved-views': '/traces-explorer',
	'/metrics-explorer/views': '/metrics-explorer/explorer',
	'/meter/explorer/views': '/meter/explorer',
	'/settings/access-tokens': '/settings/service-accounts',
	'/settings/api-keys': '/settings/service-accounts',
	'/messaging-queues': '/messaging-queues/overview',
	'/alerts/edit': '/alerts/overview',
	'/alerts/type-selection': '/alerts/new',
	// TODO(H4ad): Update this after https://github.com/SigNoz/engineering-pod/issues/5322
	'/settings/channels': '/alerts?tab=Channels',
	'/settings/channels/new': '/alerts/channels/new',
};
export const oldRoutes = Object.keys(oldNewRoutesMapping);

export const ROUTES_NOT_TO_BE_OVERRIDEN: string[] = [
	ROUTES.WORKSPACE_LOCKED,
	ROUTES.WORKSPACE_SUSPENDED,
];

export interface AppRoutes {
	component: RouteProps['component'];
	path: RouteProps['path'];
	exact: RouteProps['exact'];
	isPrivate: boolean;
	key: keyof typeof ROUTES;
}

export default routes;