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 { useCopyToClipboard } from 'react-use';
import { Button } from '@signozhq/ui/button';
import { Typography } from '@signozhq/ui/typography';
import { useNotifications } from 'hooks/useNotifications';
import { Copy } from '@signozhq/icons';
import useActiveLicenseKey from 'hooks/useActiveLicenseKey/useActiveLicenseKey';
import { AuthZGuardContent } from 'lib/authz/components/AuthZGuard/AuthZGuardContent';
import { buildLicenseReadPermission } from 'lib/authz/hooks/useAuthZ/permissions/license.permissions';
import { useAppContext } from 'providers/App/App';
import { getMaskedKey } from 'utils/maskedKey';
import './LicenseSection.styles.scss';
function LicenseSectionContent(): JSX.Element | null {
const { licenseKey } = useActiveLicenseKey();
const { notifications } = useNotifications();
const [, handleCopyToClipboard] = useCopyToClipboard();
const handleCopyKey = (text: string): void => {
handleCopyToClipboard(text);
notifications.success({
message: 'Copied to clipboard',
});
};
if (!licenseKey) {
return null;
}
return (
<div className="license-section-content">
<div className="license-section-content-item">
<div className="license-section-content-item-title-action">
<span>License key</span>
<span style={{ display: 'flex', alignItems: 'center' }}>
<Typography.Text code>{getMaskedKey(licenseKey)}</Typography.Text>
<Button
size="sm"
variant="outlined"
color="secondary"
aria-label="Copy license key"
testId="license-key-copy-btn"
onClick={(): void => handleCopyKey(licenseKey)}
icon
>
<Copy size={14} />
</Button>
</span>
</div>
<div className="license-section-content-item-description">
Your SigNoz license key.
</div>
</div>
</div>
);
}
function LicenseSection(): JSX.Element | null {
const { activeLicense } = useAppContext();
if (!activeLicense) {
return <></>;
}
return (
<div className="license-section">
<div className="license-section-header">
<div className="license-section-title">License</div>
</div>
<AuthZGuardContent checks={[buildLicenseReadPermission(activeLicense.id)]}>
<LicenseSectionContent />
</AuthZGuardContent>
</div>
);
}
export default LicenseSection;