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
import type { MouseEvent } from 'react';
import type {
DropdownActionItemType,
DropdownItemType,
} from '@signozhq/ui/dropdown';
import ROUTES from 'constants/routes';
import {
ArrowUpRight,
BarChart,
BellDot,
Book,
Bot,
Boxes,
Bug,
Building2,
ChartArea,
Cloudy,
DraftingCompass,
FileKey2,
Github,
HardDrive,
Home,
Keyboard,
Layers2,
LayoutGrid,
ListMinus,
LogOut,
MessageSquareText,
Plus,
Receipt,
Rocket,
Route,
ScrollText,
Settings,
Shield,
Slack,
Sparkles,
Unplug,
User,
UserPlus,
Users,
Binoculars,
Brain,
} from '@signozhq/icons';
import {
SecondaryMenuItemKey,
SettingsNavSection,
SidebarItem,
} from './sideNav.types';
import { Style } from '@signozhq/design-tokens';
import Noz from 'components/Noz/Noz';
import { NOZ_TOOLTIP_TITLE } from 'components/Noz/Noz.constants';
export const getStartedMenuItem = {
key: ROUTES.GET_STARTED_WITH_CLOUD,
label: 'Get Started',
icon: <Rocket size={16} style={{ transform: 'rotate(45deg)' }} />,
};
export const homeMenuItem = {
key: ROUTES.HOME,
label: 'Home',
icon: <Home size={16} />,
};
export const inviteMemberMenuItem = {
key: `${ROUTES.MEMBERS_SETTINGS}?invite=true`,
label: 'Invite Team Member',
icon: <UserPlus size={16} />,
};
export const manageLicenseMenuItem = {
key: ROUTES.LIST_LICENSES,
label: 'Manage Licenses',
icon: <FileKey2 size={16} />,
};
export const helpSupportMenuItem = {
key: ROUTES.SUPPORT,
label: 'Help & Support',
icon: <MessageSquareText size={16} />,
};
// The AI Assistant route is parameterized as `/ai-assistant/:conversationId`.
// Sending the user to `/ai-assistant/new` triggers the page's fallback that
// spawns a fresh conversation and replaces the URL with the real id, so
// every sidenav click starts a new chat (the in-page history sidebar lets
// the user resume earlier ones). Using a stable concrete path also lets
// the active-highlight map below resolve `/ai-assistant/<any id>` back to
// this menu key.
const AI_ASSISTANT_NAV_KEY = '/ai-assistant/new';
export const aiAssistantMenuItem = {
key: AI_ASSISTANT_NAV_KEY,
label: 'Noz',
icon: <Noz size={16} />,
itemKey: 'ai-assistant',
isEarlyAccess: true,
tooltip: NOZ_TOOLTIP_TITLE,
};
export const shortcutMenuItem = {
key: ROUTES.SHORTCUTS,
label: 'Keyboard Shortcuts',
icon: <Layers2 size={16} />,
};
export const slackSupportMenuItem = {
key: SecondaryMenuItemKey.Slack,
label: 'Slack Support',
icon: <Slack size={16} />,
};
export const trySignozCloudMenuItem: SidebarItem = {
key: 'trySignozCloud',
label: 'Try Signoz Cloud',
icon: <Cloudy size={16} />,
};
const menuItems: SidebarItem[] = [
{
key: ROUTES.HOME,
label: 'Home',
icon: <Home size={16} />,
itemKey: 'home',
},
{
key: ROUTES.APPLICATION,
label: 'Services',
icon: <HardDrive size={16} />,
itemKey: 'services',
},
{
key: ROUTES.LOGS,
label: 'Logs',
icon: <ScrollText size={16} />,
itemKey: 'logs',
},
{
key: ROUTES.METRICS_EXPLORER,
label: 'Metrics',
icon: <BarChart size={16} />,
isNew: false,
itemKey: 'metrics',
},
{
key: ROUTES.INFRASTRUCTURE_MONITORING_HOSTS,
label: 'Infra Monitoring',
icon: <Boxes size={16} />,
itemKey: 'infrastructure',
},
{
key: ROUTES.ALL_DASHBOARD,
label: 'Dashboards',
icon: <LayoutGrid size={16} />,
itemKey: 'dashboards',
},
{
key: ROUTES.MESSAGING_QUEUES_OVERVIEW,
label: 'Messaging Queues',
icon: <ListMinus size={16} />,
itemKey: 'messaging-queues',
},
{
key: ROUTES.API_MONITORING,
label: 'External APIs',
icon: <Binoculars size={16} />,
isNew: true,
itemKey: 'external-apis',
},
{
key: ROUTES.LIST_ALL_ALERT,
label: 'Alerts',
icon: <BellDot size={16} />,
itemKey: 'alerts',
},
{
key: ROUTES.INTEGRATIONS,
label: 'Integrations',
icon: <Unplug size={16} />,
itemKey: 'integrations',
},
{
key: ROUTES.ALL_ERROR,
label: 'Exceptions',
icon: <Bug size={16} />,
itemKey: 'exceptions',
},
{
key: ROUTES.SERVICE_MAP,
label: 'Service Map',
icon: <Route size={16} />,
isBeta: true,
itemKey: 'service-map',
},
{
key: ROUTES.BILLING,
label: 'Billing',
icon: <Receipt size={16} />,
itemKey: 'billing',
},
{
key: ROUTES.SETTINGS,
label: 'Settings',
icon: <Settings size={16} />,
itemKey: 'settings',
},
];
export const primaryMenuItems: SidebarItem[] = [
{
key: ROUTES.HOME,
label: 'Home',
icon: <Home size={16} />,
itemKey: 'home',
},
{
key: ROUTES.LIST_ALL_ALERT,
label: 'Alerts',
icon: <BellDot size={16} />,
itemKey: 'alerts',
},
{
key: ROUTES.ALL_DASHBOARD,
label: 'Dashboards',
icon: <LayoutGrid size={16} />,
itemKey: 'dashboards',
},
];
export const defaultMoreMenuItems: SidebarItem[] = [
{
key: ROUTES.APPLICATION,
label: 'Services',
icon: <HardDrive size={16} />,
isPinned: true,
isEnabled: true,
itemKey: 'services',
},
{
key: ROUTES.LOGS,
label: 'Logs',
icon: <ScrollText size={16} />,
isPinned: true,
isEnabled: true,
itemKey: 'logs',
},
{
key: ROUTES.TRACES_EXPLORER,
label: 'Traces',
icon: <DraftingCompass size={16} />,
isPinned: true,
isEnabled: true,
itemKey: 'traces',
},
{
key: ROUTES.METRICS_EXPLORER,
label: 'Metrics',
icon: <BarChart size={16} />,
isNew: false,
isEnabled: true,
itemKey: 'metrics',
},
{
key: ROUTES.INFRASTRUCTURE_MONITORING_HOSTS,
label: 'Infrastructure',
icon: <Boxes size={16} />,
isPinned: true,
isEnabled: true,
itemKey: 'infrastructure',
},
{
key: ROUTES.INTEGRATIONS,
label: 'Integrations',
icon: <Unplug size={16} />,
isEnabled: true,
itemKey: 'integrations',
},
{
key: ROUTES.ALL_ERROR,
label: 'Exceptions',
icon: <Bug size={16} />,
isEnabled: true,
itemKey: 'exceptions',
},
{
key: ROUTES.API_MONITORING,
label: 'External APIs',
icon: <Binoculars size={16} />,
isEnabled: true,
itemKey: 'external-apis',
},
{
key: ROUTES.AI_OBSERVABILITY_OVERVIEW,
label: 'AI Observability',
icon: <Brain size={16} />,
isBeta: true,
isEnabled: true,
itemKey: 'ai-observability',
},
{
key: ROUTES.METER,
label: 'Cost Meter',
icon: <ChartArea size={16} />,
isNew: false,
isEnabled: true,
isBeta: false,
itemKey: 'meter-explorer',
},
{
key: ROUTES.MESSAGING_QUEUES_OVERVIEW,
label: 'Messaging Queues',
icon: <ListMinus size={16} />,
isEnabled: true,
itemKey: 'messaging-queues',
},
{
key: ROUTES.SERVICE_MAP,
label: 'Service Map',
icon: <Route size={16} />,
isEnabled: true,
itemKey: 'service-map',
},
];
export const settingsNavSections: SettingsNavSection[] = [
{
key: 'general',
items: [
{
key: ROUTES.SETTINGS,
label: 'Workspace',
icon: <Settings size={16} />,
isEnabled: true,
itemKey: 'workspace',
},
{
key: ROUTES.MY_SETTINGS,
label: 'Account',
icon: <User size={16} />,
isEnabled: true,
itemKey: 'account',
},
{
key: ROUTES.BILLING,
label: 'Billing',
icon: <Receipt size={16} />,
isEnabled: false,
itemKey: 'billing',
},
{
key: ROUTES.INTEGRATIONS,
label: 'Integrations',
icon: <Unplug size={16} />,
isEnabled: false,
itemKey: 'integrations',
},
{
key: ROUTES.MCP_SERVER,
label: 'MCP Server',
icon: <Sparkles size={16} />,
isEnabled: false,
itemKey: 'mcp-server',
},
],
},
{
key: 'identity-access',
title: 'Identity & Access',
items: [
{
key: ROUTES.ROLES_SETTINGS,
label: 'Roles',
icon: <Shield size={16} />,
isEnabled: false,
itemKey: 'roles',
isBeta: true,
},
{
key: ROUTES.MEMBERS_SETTINGS,
label: 'Members',
icon: <Users size={16} />,
isEnabled: false,
itemKey: 'members',
},
{
key: ROUTES.SERVICE_ACCOUNTS_SETTINGS,
label: 'Service Accounts',
icon: <Bot size={16} />,
isEnabled: false,
itemKey: 'service-accounts',
},
{
key: ROUTES.INGESTION_SETTINGS,
label: 'Ingestion',
icon: <Rocket size={16} style={{ transform: 'rotate(45deg)' }} />,
isEnabled: false,
itemKey: 'ingestion',
},
],
},
{
key: 'authentication',
title: 'Authentication',
items: [
{
key: ROUTES.ORG_SETTINGS,
label: 'Single Sign-on',
icon: <User size={16} />,
isEnabled: false,
itemKey: 'sso',
},
],
},
{
key: 'shortcuts',
hasDivider: true,
items: [
{
key: ROUTES.SHORTCUTS,
label: 'Keyboard Shortcuts',
icon: <Keyboard size={16} />,
isEnabled: true,
itemKey: 'keyboard-shortcuts',
},
],
},
];
export const helpSupportDropdownMenuItems: SidebarItem[] = [
{
key: 'documentation',
label: (
<div className="nav-item-label-container">
<span>Documentation</span>
<ArrowUpRight size={14} />
</div>
),
icon: <Book size={14} />,
isExternal: true,
url: 'https://signoz.io/docs',
itemKey: 'documentation',
},
{
key: 'github',
label: (
<div className="nav-item-label-container">
<span>GitHub</span>
<ArrowUpRight size={14} />
</div>
),
icon: <Github size={14} />,
isExternal: true,
url: 'https://github.com/signoz/signoz',
itemKey: 'github',
},
{
key: 'slack',
label: (
<div className="nav-item-label-container">
<span>Community Slack</span>
<ArrowUpRight size={14} />
</div>
),
icon: <Slack size={14} />,
isExternal: true,
url: 'https://signoz.io/slack',
itemKey: 'community-slack',
},
{
key: 'chat-support',
label: 'Chat with Support',
icon: <MessageSquareText size={14} />,
itemKey: 'chat-support',
},
{
key: 'invite-collaborators',
label: 'Invite a Team Member',
icon: <Plus size={14} />,
itemKey: 'invite-collaborators',
},
];
export type UserSettingsMenuKey =
| 'workspace'
| 'account'
| 'license'
| 'keyboard-shortcuts'
| 'logout';
export const USER_SETTINGS_MENU_LABELS: Record<UserSettingsMenuKey, string> = {
workspace: 'Workspace Settings',
account: 'Account Settings',
license: 'Manage License',
'keyboard-shortcuts': 'Keyboard Shortcuts',
logout: 'Sign out',
};
export const WORKSPACE_LOCKED_TOOLTIP =
'Unavailable while the workspace is locked';
export interface UserSettingsMenuItemsParams {
userEmail: string;
isWorkspaceBlocked: boolean;
isEnterpriseSelfHostedUser: boolean;
isCommunityEnterpriseUser: boolean;
onSelect: (key: UserSettingsMenuKey, event: MouseEvent) => void;
}
export const getUserSettingsDropdownMenuItems = ({
userEmail,
isWorkspaceBlocked,
isEnterpriseSelfHostedUser,
isCommunityEnterpriseUser,
onSelect,
}: UserSettingsMenuItemsParams): DropdownItemType[] => {
const settingsRows: DropdownActionItemType[] = [
{
type: 'item',
value: 'workspace',
label: USER_SETTINGS_MENU_LABELS.workspace,
prefix: <Building2 size={14} color={Style.L1_FOREGROUND} />,
testId: 'workspace-settings-nav-item',
disabled: isWorkspaceBlocked,
disabledTooltip: WORKSPACE_LOCKED_TOOLTIP,
onClick: (event): void => onSelect('workspace', event),
},
{
type: 'item',
value: 'account',
label: USER_SETTINGS_MENU_LABELS.account,
prefix: <User size={14} color={Style.L1_FOREGROUND} />,
testId: 'account-settings-nav-item',
onClick: (event): void => onSelect('account', event),
},
];
if (isEnterpriseSelfHostedUser || isCommunityEnterpriseUser) {
settingsRows.push({
type: 'item',
value: 'license',
label: USER_SETTINGS_MENU_LABELS.license,
prefix: <Shield size={14} color={Style.L1_FOREGROUND} />,
testId: 'manage-license-nav-item',
onClick: (event): void => onSelect('license', event),
});
}
settingsRows.push({
type: 'item',
value: 'keyboard-shortcuts',
label: USER_SETTINGS_MENU_LABELS['keyboard-shortcuts'],
prefix: <Keyboard size={14} color={Style.L1_FOREGROUND} />,
testId: 'keyboard-shortcuts-nav-item',
onClick: (event): void => onSelect('keyboard-shortcuts', event),
});
return [
{
type: 'group',
value: 'logged-in-as',
label: (
<div className="user-settings-dropdown-logged-in-section">
<span className="user-settings-dropdown-label-text">LOGGED IN AS</span>
<span className="user-settings-dropdown-label-email">{userEmail}</span>
</div>
),
testId: 'logged-in-as-nav-item',
items: settingsRows,
},
{ type: 'separator', value: 'before-logout' },
{
type: 'item',
value: 'logout',
label: USER_SETTINGS_MENU_LABELS.logout,
prefix: <LogOut size={14} />,
testId: 'logout-nav-item',
danger: true,
onClick: (event): void => onSelect('logout', event),
},
];
};
/** Mapping of some newly added routes and their corresponding active sidebar menu key
This is used to highlight the correct menu item when the user navigates to a new route
**/
export const NEW_ROUTES_MENU_ITEM_KEY_MAP: Record<string, string> = {
[ROUTES.TRACE_BASE]: ROUTES.TRACES_EXPLORER,
[ROUTES.TRACE_EXPLORER]: ROUTES.TRACES_EXPLORER,
[ROUTES.LOGS_BASE]: ROUTES.LOGS_EXPLORER,
[ROUTES.METRICS_EXPLORER_BASE]: ROUTES.METRICS_EXPLORER,
[ROUTES.INFRASTRUCTURE_MONITORING_BASE]:
ROUTES.INFRASTRUCTURE_MONITORING_HOSTS,
[ROUTES.API_MONITORING_BASE]: ROUTES.API_MONITORING,
[ROUTES.MESSAGING_QUEUES_BASE]: ROUTES.MESSAGING_QUEUES_OVERVIEW,
[ROUTES.AI_OBSERVABILITY_BASE]: ROUTES.AI_OBSERVABILITY_OVERVIEW,
// `getActiveMenuKeyFromPath` strips the URL down to its first segment;
// `/ai-assistant/<id>` reduces to `/ai-assistant`, which we point back
// to the AI Assistant menu item's concrete key.
[ROUTES.AI_ASSISTANT_BASE]: AI_ASSISTANT_NAV_KEY,
};
export default menuItems;