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 { useMemo } from 'react';
import { useAppLocation } from 'lib/router/useAppLocation';
import ROUTES from 'constants/routes';
import LiveLogsPauseResume from 'container/LiveLogs/LiveLogsPauseResume/LiveLogsPauseResume';
import DateTimeSelectionV2 from 'container/TopNav/DateTimeSelectionV2';
import { noop } from 'lodash-es';
import './Toolbar.styles.scss';
interface ToolbarProps {
showAutoRefresh: boolean;
leftActions?: JSX.Element;
rightActions?: JSX.Element;
warningElement?: JSX.Element;
onGoLive?: () => void;
onExitLiveLogs?: () => void;
showLiveLogs?: boolean;
}
export default function Toolbar({
showAutoRefresh,
leftActions,
rightActions,
warningElement,
showLiveLogs,
onGoLive,
onExitLiveLogs,
}: ToolbarProps): JSX.Element {
const { pathname } = useAppLocation();
const isLogsExplorerPage = useMemo(
() => pathname === ROUTES.LOGS_EXPLORER,
[pathname],
);
const isApiMonitoringPage = useMemo(
() => pathname === ROUTES.API_MONITORING,
[pathname],
);
return (
<div className="toolbar">
<div className="leftActions">{leftActions}</div>
<div className="rightActions">
<div className="timeRange">
{warningElement}
{showLiveLogs && <LiveLogsPauseResume />}
<DateTimeSelectionV2
showLiveLogs={showLiveLogs}
onExitLiveLogs={onExitLiveLogs}
onGoLive={onGoLive}
showAutoRefresh={showAutoRefresh}
showRefreshText={!isLogsExplorerPage && !isApiMonitoringPage}
hideShareModal
/>
</div>
{rightActions}
</div>
</div>
);
}
Toolbar.defaultProps = {
leftActions: <div />,
rightActions: <div />,
warningElement: <div />,
showLiveLogs: false,
onGoLive: (): void => noop(),
onExitLiveLogs: (): void => {},
};