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.

feat: added doc links for service account and misc changes (#10804)

SagarRajput-7b6b689902d34
diff --git a/frontend/src/components/AnnouncementBanner/AnnouncementBanner.styles.scss b/frontend/src/components/AnnouncementBanner/AnnouncementBanner.styles.scss
deleted file mode 100644
index a3f95c2234..0000000000
--- a/frontend/src/components/AnnouncementBanner/AnnouncementBanner.styles.scss
+++ /dev/null
@@ -1,97 +0,0 @@
-.announcement-banner {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: var(--spacing-4);
- padding: var(--padding-2) var(--padding-4);
- height: 40px;
- font-family: var(--font-sans), sans-serif;
- font-size: var(--label-base-500-font-size);
- line-height: var(--label-base-500-line-height);
- font-weight: var(--label-base-500-font-weight);
- letter-spacing: -0.065px;
-
- &--warning {
- background-color: var(--callout-warning-background);
- color: var(--callout-warning-description);
- .announcement-banner__action,
- .announcement-banner__dismiss {
- background: var(--callout-warning-border);
- }
- }
-
- &--info {
- background-color: var(--callout-primary-background);
- color: var(--callout-primary-description);
- .announcement-banner__action,
- .announcement-banner__dismiss {
- background: var(--callout-primary-border);
- }
- }
-
- &--error {
- background-color: var(--callout-error-background);
- color: var(--callout-error-description);
- .announcement-banner__action,
- .announcement-banner__dismiss {
- background: var(--callout-error-border);
- }
- }
-
- &--success {
- background-color: var(--callout-success-background);
- color: var(--callout-success-description);
- .announcement-banner__action,
- .announcement-banner__dismiss {
- background: var(--callout-success-border);
- }
- }
-
- &__body {
- display: flex;
- align-items: center;
- gap: var(--spacing-4);
- flex: 1;
- min-width: 0;
- }
-
- &__icon {
- display: flex;
- align-items: center;
- flex-shrink: 0;
- }
-
- &__message {
- flex: 1;
- min-width: 0;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- line-height: var(--line-height-normal);
-
- strong {
- font-weight: var(--font-weight-semibold);
- }
- }
-
- &__action {
- height: 24px;
- font-size: var(--label-small-500-font-size);
- color: currentColor;
-
- &:hover {
- opacity: 0.8;
- }
- }
-
- &__dismiss {
- width: 24px;
- height: 24px;
- padding: 0;
- color: currentColor;
-
- &:hover {
- opacity: 0.8;
- }
- }
-}
diff --git a/frontend/src/components/AnnouncementBanner/AnnouncementBanner.test.tsx b/frontend/src/components/AnnouncementBanner/AnnouncementBanner.test.tsx
deleted file mode 100644
index f960a30cdb..0000000000
--- a/frontend/src/components/AnnouncementBanner/AnnouncementBanner.test.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-import { render, screen, userEvent } from 'tests/test-utils';
-
-import {
- AnnouncementBanner,
- AnnouncementBannerProps,
- PersistedAnnouncementBanner,
-} from './index';
-
-const STORAGE_KEY = 'test-banner-dismissed';
-
-function renderBanner(props: Partial<AnnouncementBannerProps> = {}): void {
- render(<AnnouncementBanner message="Test message" {...props} />);
-}
-
-afterEach(() => {
- localStorage.removeItem(STORAGE_KEY);
-});
-
-describe('AnnouncementBanner', () => {
- it('renders message and default warning variant', () => {
- renderBanner({ message: <strong>Heads up</strong> });
-
- const alert = screen.getByRole('alert');
- expect(alert).toHaveClass('announcement-banner--warning');
- expect(alert).toHaveTextContent('Heads up');
- });
-
- it.each(['warning', 'info', 'success', 'error'] as const)(
- 'renders %s variant correctly',
- (type) => {
- renderBanner({ type, message: 'Test message' });
- const alert = screen.getByRole('alert');
- expect(alert).toHaveClass(`announcement-banner--${type}`);
- },
- );
-
- it('calls action onClick when action button is clicked', async () => {
- const onClick = jest.fn() as jest.MockedFunction<() => void>;
- renderBanner({ action: { label: 'Go to Settings', onClick } });
-
- const user = userEvent.setup({ pointerEventsCheck: 0 });
- await user.click(screen.getByRole('button', { name: /go to settings/i }));
-
- expect(onClick).toHaveBeenCalledTimes(1);
- });
-
- it('hides dismiss button when onClose is not provided and hides icon when icon is null', () => {
- renderBanner({ onClose: undefined, icon: null });
-
- expect(
- screen.queryByRole('button', { name: /dismiss/i }),
- ).not.toBeInTheDocument();
- expect(
- screen.queryByRole('alert')?.querySelector('.announcement-banner__icon'),
- ).not.toBeInTheDocument();
- });
-});
-
-describe('PersistedAnnouncementBanner', () => {
- it('dismisses on click, calls onDismiss, and persists to localStorage', async () => {
- const onDismiss = jest.fn() as jest.MockedFunction<() => void>;
- render(
- <PersistedAnnouncementBanner
- message="Test message"
- storageKey={STORAGE_KEY}
- onDismiss={onDismiss}
- />,
- );
-
- const user = userEvent.setup({ pointerEventsCheck: 0 });
- await user.click(screen.getByRole('button', { name: /dismiss/i }));
-
- expect(screen.queryByRole('alert')).not.toBeInTheDocument();
- expect(onDismiss).toHaveBeenCalledTimes(1);
- expect(localStorage.getItem(STORAGE_KEY)).toBe('true');
- });
-
- it('does not render when storageKey is already set in localStorage', () => {
- localStorage.setItem(STORAGE_KEY, 'true');
- render(
- <PersistedAnnouncementBanner
- message="Test message"
- storageKey={STORAGE_KEY}
- />,
- );
-
- expect(screen.queryByRole('alert')).not.toBeInTheDocument();
- });
-});
diff --git a/frontend/src/components/AnnouncementBanner/AnnouncementBanner.tsx b/frontend/src/components/AnnouncementBanner/AnnouncementBanner.tsx
deleted file mode 100644
index 5047116189..0000000000
--- a/frontend/src/components/AnnouncementBanner/AnnouncementBanner.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-import { ReactNode } from 'react';
-import { Button } from '@signozhq/button';
-import {
- CircleAlert,
- CircleCheckBig,
- Info,
- TriangleAlert,
- X,
-} from '@signozhq/icons';
-import cx from 'classnames';
-
-import './AnnouncementBanner.styles.scss';
-
-export type AnnouncementBannerType = 'warning' | 'info' | 'error' | 'success';
-
-export interface AnnouncementBannerAction {
- label: string;
- onClick: () => void;
-}
-
-export interface AnnouncementBannerProps {
- message: ReactNode;
- type?: AnnouncementBannerType;
- icon?: ReactNode | null;
- action?: AnnouncementBannerAction;
- onClose?: () => void;
- className?: string;
-}
-
-const DEFAULT_ICONS: Record<AnnouncementBannerType, ReactNode> = {
- warning: <TriangleAlert size={14} />,
- info: <Info size={14} />,
- error: <CircleAlert size={14} />,
- success: <CircleCheckBig size={14} />,
-};
-
-export default function AnnouncementBanner({
- message,
- type = 'warning',
- icon,
- action,
- onClose,
- className,
-}: AnnouncementBannerProps): JSX.Element {
- const resolvedIcon = icon === null ? null : icon ?? DEFAULT_ICONS[type];
-
- return (
- <div
- role="alert"
- className={cx(
- 'announcement-banner',
- `announcement-banner--${type}`,
- className,
- )}
- >
- <div className="announcement-banner__body">
- {resolvedIcon && (
- <span className="announcement-banner__icon">{resolvedIcon}</span>
- )}
- <span className="announcement-banner__message">{message}</span>
- {action && (
- <Button
- type="button"
- className="announcement-banner__action"
- onClick={action.onClick}
- >
- {action.label}
- </Button>
- )}
- </div>
-
- {onClose && (
- <Button
- type="button"
- aria-label="Dismiss"
- className="announcement-banner__dismiss"
- onClick={onClose}
- >
- <X size={14} />
- </Button>
- )}
- </div>
- );
-}
diff --git a/frontend/src/components/AnnouncementBanner/PersistedAnnouncementBanner.tsx b/frontend/src/components/AnnouncementBanner/PersistedAnnouncementBanner.tsx
deleted file mode 100644
index d9302b0e9a..0000000000
--- a/frontend/src/components/AnnouncementBanner/PersistedAnnouncementBanner.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import { useState } from 'react';
-
-import AnnouncementBanner, {
- AnnouncementBannerProps,
-} from './AnnouncementBanner';
-
-interface PersistedAnnouncementBannerProps extends AnnouncementBannerProps {
- storageKey: string;
- onDismiss?: () => void;
-}
-
-function isDismissed(storageKey: string): boolean {
- return localStorage.getItem(storageKey) === 'true';
-}
-
-export default function PersistedAnnouncementBanner({
- storageKey,
- onDismiss,
- ...props
-}: PersistedAnnouncementBannerProps): JSX.Element | null {
- const [visible, setVisible] = useState(() => !isDismissed(storageKey));
-
- if (!visible) {
- return null;
- }
-
- const handleClose = (): void => {
- localStorage.setItem(storageKey, 'true');
- setVisible(false);
- onDismiss?.();
- };
-
- return <AnnouncementBanner {...props} onClose={handleClose} />;
-}
diff --git a/frontend/src/components/AnnouncementBanner/index.ts b/frontend/src/components/AnnouncementBanner/index.ts
deleted file mode 100644
index 94e1989188..0000000000
--- a/frontend/src/components/AnnouncementBanner/index.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import AnnouncementBanner from './AnnouncementBanner';
-import PersistedAnnouncementBanner from './PersistedAnnouncementBanner';
-
-export type {
- AnnouncementBannerAction,
- AnnouncementBannerProps,
- AnnouncementBannerType,
-} from './AnnouncementBanner';
-
-export { AnnouncementBanner, PersistedAnnouncementBanner };
-
-export default AnnouncementBanner;
diff --git a/frontend/src/components/ServiceAccountDrawer/KeysTab.tsx b/frontend/src/components/ServiceAccountDrawer/KeysTab.tsx
index 1aacbc52dd..9a4a5ad609 100644
--- a/frontend/src/components/ServiceAccountDrawer/KeysTab.tsx
+++ b/frontend/src/components/ServiceAccountDrawer/KeysTab.tsx
@@ -165,7 +165,17 @@ function KeysTab({
return (
<div className="keys-tab__empty">
<KeyRound size={24} className="keys-tab__empty-icon" />
- <p className="keys-tab__empty-text">No keys. Start by creating one.</p>
+ <p className="keys-tab__empty-text">
+ No keys. Start by creating one.{' '}
+ <a
+ href="https://signoz.io/docs/manage/administrator-guide/iam/service-accounts/#step-3-generate-an-api-key"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="keys-tab__learn-more"
+ >
+ Learn more
+ </a>
+ </p>
<Button
type="button"
className="keys-tab__learn-more"
diff --git a/frontend/src/constants/shortcutActions.tsx b/frontend/src/constants/shortcutActions.tsx
index 3db1eed162..a43c0715cc 100644
--- a/frontend/src/constants/shortcutActions.tsx
+++ b/frontend/src/constants/shortcutActions.tsx
@@ -248,5 +248,35 @@ export function createShortcutActions(deps: ActionDeps): CmdAction[] {
roles: ['ADMIN', 'EDITOR'],
perform: (): void => navigate(ROUTES.BILLING),
},
+ {
+ id: 'my-settings-service-accounts',
+ name: 'Go to Service Accounts',
+ shortcut: [GlobalShortcutsName.NavigateToSettingsServiceAccounts],
+ keywords: 'settings service accounts',
+ section: 'Settings',
+ icon: <Settings size={14} />,
+ roles: ['ADMIN'],
+ perform: (): void => navigate(ROUTES.SERVICE_ACCOUNTS_SETTINGS),
+ },
+ {
+ id: 'my-settings-roles',
+ name: 'Go to Roles',
+ shortcut: [GlobalShortcutsName.NavigateToSettingsRoles],
+ keywords: 'settings roles',
+ section: 'Settings',
+ icon: <Settings size={14} />,
+ roles: ['ADMIN'],
+ perform: (): void => navigate(ROUTES.ROLES_SETTINGS),
+ },
+ {
+ id: 'my-settings-members',
+ name: 'Go to Members',
+ shortcut: [GlobalShortcutsName.NavigateToSettingsMembers],
+ keywords: 'settings members',
+ section: 'Settings',
+ icon: <Settings size={14} />,
+ roles: ['ADMIN'],
+ perform: (): void => navigate(ROUTES.MEMBERS_SETTINGS),
+ },
];
}
diff --git a/frontend/src/constants/shortcuts/globalShortcuts.ts b/frontend/src/constants/shortcuts/globalShortcuts.ts
index 23ac597933..a6c8bf6645 100644
--- a/frontend/src/constants/shortcuts/globalShortcuts.ts
+++ b/frontend/src/constants/shortcuts/globalShortcuts.ts
@@ -27,6 +27,9 @@ export const GlobalShortcuts = {
NavigateToSettingsIngestion: 'shift+g+i',
NavigateToSettingsBilling: 'shift+g+b',
NavigateToSettingsNotificationChannels: 'shift+g+n',
+ NavigateToSettingsServiceAccounts: 'shift+g+k',
+ NavigateToSettingsRoles: 'shift+g+r',
+ NavigateToSettingsMembers: 'shift+g+m',
};
export const GlobalShortcutsName = {
@@ -47,6 +50,9 @@ export const GlobalShortcutsName = {
NavigateToSettingsIngestion: 'shift+g+i',
NavigateToSettingsBilling: 'shift+g+b',
NavigateToSettingsNotificationChannels: 'shift+g+n',
+ NavigateToSettingsServiceAccounts: 'shift+g+k',
+ NavigateToSettingsRoles: 'shift+g+r',
+ NavigateToSettingsMembers: 'shift+g+m',
NavigateToLogs: 'shift+l',
NavigateToLogsPipelines: 'shift+l+p',
NavigateToLogsViews: 'shift+l+v',
@@ -74,4 +80,7 @@ export const GlobalShortcutsDescription = {
'Navigate to Notification Channels Settings',
NavigateToLogsPipelines: 'Navigate to Logs Pipelines',
NavigateToLogsViews: 'Navigate to Logs Views',
+ NavigateToSettingsServiceAccounts: 'Navigate to Service Accounts Settings',
+ NavigateToSettingsRoles: 'Navigate to Roles Settings',
+ NavigateToSettingsMembers: 'Navigate to Members Settings',
};
diff --git a/frontend/src/container/Home/Home.tsx b/frontend/src/container/Home/Home.tsx
index a5ea97047c..d3e479f0a2 100644
--- a/frontend/src/container/Home/Home.tsx
+++ b/frontend/src/container/Home/Home.tsx
@@ -3,12 +3,12 @@ import React, { useCallback, useEffect, useState } from 'react';
import { useMutation, useQuery } from 'react-query';
import { Color } from '@signozhq/design-tokens';
import { Compass, Dot, House, Plus, Wrench } from '@signozhq/icons';
+import { PersistedAnnouncementBanner } from '@signozhq/ui';
import { Button, Popover } from 'antd';
import logEvent from 'api/common/logEvent';
import { useGetMetricsOnboardingStatus } from 'api/generated/services/metrics';
import listUserPreferences from 'api/v1/user/preferences/list';
import updateUserPreferenceAPI from 'api/v1/user/preferences/name/update';
-import { PersistedAnnouncementBanner } from 'components/AnnouncementBanner';
import Header from 'components/Header/Header';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { LOCALSTORAGE } from 'constants/localStorage';
@@ -265,20 +265,19 @@ export default function Home(): JSX.Element {
return (
<div className="home-container">
<PersistedAnnouncementBanner
- type="warning"
+ type="info"
storageKey={LOCALSTORAGE.DISMISSED_API_KEYS_DEPRECATION_BANNER}
- message={
- <>
- <strong>API Keys</strong> have been deprecated and replaced by{' '}
- <strong>Service Accounts</strong>. Please migrate to Service Accounts for
- programmatic API access.
- </>
- }
action={{
label: 'Go to Service Accounts',
onClick: (): void => history.push(ROUTES.SERVICE_ACCOUNTS_SETTINGS),
}}
- />
+ >
+ <>
+ <strong>API keys</strong> have been deprecated in favour of{' '}
+ <strong>Service accounts</strong>. The existing API Keys have been migrated
+ to service accounts.
+ </>
+ </PersistedAnnouncementBanner>
<div className="sticky-header">
<Header
diff --git a/frontend/src/container/ServiceAccountsSettings/ServiceAccountsSettings.tsx b/frontend/src/container/ServiceAccountsSettings/ServiceAccountsSettings.tsx
index ef7082a45b..177c43c3c8 100644
--- a/frontend/src/container/ServiceAccountsSettings/ServiceAccountsSettings.tsx
+++ b/frontend/src/container/ServiceAccountsSettings/ServiceAccountsSettings.tsx
@@ -198,15 +198,14 @@ function ServiceAccountsSettings(): JSX.Element {
<h1 className="sa-settings__title">Service Accounts</h1>
<p className="sa-settings__subtitle">
Overview of service accounts added to this workspace.{' '}
- {/* Todo: to add doc links */}
- {/* <a
- href="https://signoz.io/docs/service-accounts"
+ <a
+ href="https://signoz.io/docs/manage/administrator-guide/iam/service-accounts"
target="_blank"
rel="noopener noreferrer"
className="sa-settings__learn-more"
>
Learn more
- </a> */}
+ </a>
</p>
</div>
diff --git a/frontend/src/container/SideNav/SideNav.tsx b/frontend/src/container/SideNav/SideNav.tsx
index afc8a2895b..34a22bc55b 100644
--- a/frontend/src/container/SideNav/SideNav.tsx
+++ b/frontend/src/container/SideNav/SideNav.tsx
@@ -695,6 +695,15 @@ function SideNav({ isPinned }: { isPinned: boolean }): JSX.Element {
registerShortcut(GlobalShortcuts.NavigateToSettingsNotificationChannels, () =>
onClickHandler(ROUTES.ALL_CHANNELS, null),
);
+ registerShortcut(GlobalShortcuts.NavigateToSettingsServiceAccounts, () =>
+ onClickHandler(ROUTES.SERVICE_ACCOUNTS_SETTINGS, null),
+ );
+ registerShortcut(GlobalShortcuts.NavigateToSettingsRoles, () =>
+ onClickHandler(ROUTES.ROLES_SETTINGS, null),
+ );
+ registerShortcut(GlobalShortcuts.NavigateToSettingsMembers, () =>
+ onClickHandler(ROUTES.MEMBERS_SETTINGS, null),
+ );
registerShortcut(GlobalShortcuts.NavigateToLogsPipelines, () =>
onClickHandler(ROUTES.LOGS_PIPELINES, null),
);
@@ -718,6 +727,9 @@ function SideNav({ isPinned }: { isPinned: boolean }): JSX.Element {
deregisterShortcut(GlobalShortcuts.NavigateToSettingsIngestion);
deregisterShortcut(GlobalShortcuts.NavigateToSettingsBilling);
deregisterShortcut(GlobalShortcuts.NavigateToSettingsNotificationChannels);
+ deregisterShortcut(GlobalShortcuts.NavigateToSettingsServiceAccounts);
+ deregisterShortcut(GlobalShortcuts.NavigateToSettingsRoles);
+ deregisterShortcut(GlobalShortcuts.NavigateToSettingsMembers);
deregisterShortcut(GlobalShortcuts.NavigateToLogsPipelines);
deregisterShortcut(GlobalShortcuts.NavigateToLogsViews);
deregisterShortcut(GlobalShortcuts.NavigateToTracesViews);
diff --git a/frontend/src/pages/Settings/Settings.tsx b/frontend/src/pages/Settings/Settings.tsx
index 57611f5479..39d79b64a3 100644
--- a/frontend/src/pages/Settings/Settings.tsx
+++ b/frontend/src/pages/Settings/Settings.tsx
@@ -143,7 +143,9 @@ function SettingsPage(): JSX.Element {
isEnabled:
item.key === ROUTES.ORG_SETTINGS ||
item.key === ROUTES.MEMBERS_SETTINGS ||
- item.key === ROUTES.SERVICE_ACCOUNTS_SETTINGS
+ item.key === ROUTES.SERVICE_ACCOUNTS_SETTINGS ||
+ item.key === ROUTES.ROLES_SETTINGS ||
+ item.key === ROUTES.ROLE_DETAILS
? true
: item.isEnabled,
}));
diff --git a/frontend/src/pages/Settings/utils.ts b/frontend/src/pages/Settings/utils.ts
index 9521f95cc7..c472abef17 100644
--- a/frontend/src/pages/Settings/utils.ts
+++ b/frontend/src/pages/Settings/utils.ts
@@ -62,12 +62,16 @@ export const getRoutes = (
settings.push(...alertChannels(t));
if (isAdmin) {
- settings.push(...membersSettings(t), ...serviceAccountsSettings(t));
+ settings.push(
+ ...membersSettings(t),
+ ...serviceAccountsSettings(t),
+ ...rolesSettings(t),
+ ...roleDetails(t),
+ );
}
- // todo: Sagar - check the condition for role list and details page, to whom we want to serve
if ((isCloudUser || isEnterpriseSelfHostedUser) && isAdmin) {
- settings.push(...billingSettings(t), ...rolesSettings(t), ...roleDetails(t));
+ settings.push(...billingSettings(t));
}
settings.push(