Compare commits

...

11 Commits

Author SHA1 Message Date
Manika Malhotra
681603e365 chore(frontend): remove an emptied stylesheet and a rule left without users 2026-11-30 14:45:09 +05:30
Manika Malhotra
29bd9896c4 chore(traces): keep KEY_ATTRIBUTE_KEYS for the parked key attributes section 2026-11-30 14:44:48 +05:30
Manika Malhotra
39ada9604a refactor(frontend): keep the exports of code that stays 2026-11-30 13:57:02 +05:30
Manika Malhotra
018611fd49 chore(frontend): remove dead global styles 2026-11-30 13:27:32 +05:30
Manika Malhotra
c85af868f0 chore(frontend): remove unused CSS module classes 2026-11-30 13:27:29 +05:30
Manika Malhotra
a1700275cb refactor(frontend): remove unused exports 2026-11-30 13:27:21 +05:30
Manika Malhotra
eeb040020f test(frontend): remove mocks of modules the tests no longer load 2026-11-30 13:27:16 +05:30
Manika Malhotra
718cf02162 chore(logs): drop the Radix popper check from the log detail body 2026-11-30 13:27:11 +05:30
Manika Malhotra
e95ff8e53c chore(storybook): drop v3 autocomplete mocks from logs, traces and API monitoring stories 2026-11-30 13:27:07 +05:30
Manika Malhotra
3185504015 chore(frontend): remove components only their own tests use 2026-11-30 13:27:02 +05:30
Manika Malhotra
fd1329bf60 chore(frontend): remove unused files 2026-11-30 13:27:01 +05:30
67 changed files with 2 additions and 2313 deletions

View File

@@ -72,7 +72,6 @@ function LogDetailBody({
target.closest('.cm-tooltip-autocomplete') ||
target.closest('.drawer-popover') ||
target.closest('.query-status-popover') ||
target.closest('[data-radix-popper-content-wrapper]') ||
target.closest('[data-base-ui-portal]')
) {
return;

View File

@@ -155,14 +155,6 @@
background: var(--l2-background);
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
.context-btn {
width: 50% !important;
}
.copy-link-btn {
width: 50% !important;
border-left: 1px solid var(--l1-border) !important;
}
.ant-btn-default {
border: none;
box-shadow: none;

View File

@@ -83,9 +83,3 @@ export const LogText = styled.div<LogTextProps>`
: 'white-space: nowrap;'};
};
`;
export const SelectedLog = styled.div`
display: flex;
width: 100%;
overflow: hidden;
`;

View File

@@ -27,14 +27,3 @@
border-color: var(--l1-border) !important;
}
}
// In table/column view, keep action buttons visible at the viewport's right edge
.log-line-action-buttons.table-view-log-actions {
position: absolute;
top: 50%;
right: 8px;
left: auto;
transform: translateY(-50%);
margin: 0;
z-index: 5;
}

View File

@@ -1,7 +1,4 @@
import { blue } from '@ant-design/colors';
import { Color } from '@signozhq/design-tokens';
import Space from 'periscope/components/Space/Space';
import Col from 'periscope/components/Col/Col';
import Row from 'periscope/components/Row/Row';
import { FontSize } from 'container/OptionsMenu/types';
import { Info } from '@signozhq/icons';
@@ -73,12 +70,6 @@ export const InfoIconWrapper = styled(Info)`
height: auto;
`;
export const ExpandIconWrapper = styled(Col)`
color: ${blue[6]};
padding: 0.25rem 0.375rem;
cursor: pointer;
`;
export const RawLogContent = styled.div<RawLogContentProps>`
margin-bottom: 0;
font-family: 'SF Mono', monospace;
@@ -112,11 +103,3 @@ export const RawLogContent = styled.div<RawLogContentProps>`
cursor: ${({ $isActiveLog, $isReadOnly }): string =>
$isActiveLog || $isReadOnly ? 'initial' : 'pointer'};
`;
export const ActionButtonsWrapper = styled(Space)`
position: absolute;
transform: translate(-50%, -50%);
top: 50%;
right: 0;
cursor: pointer;
`;

View File

@@ -187,177 +187,6 @@
padding: 12px;
}
.add-new-column-container {
display: flex;
flex-direction: column;
.add-new-column-header {
display: flex;
flex-direction: column;
padding: 8px;
gap: 8px;
.back-icon {
cursor: pointer;
}
.title {
display: flex;
gap: 4px;
align-items: center;
color: var(--muted-foreground);
}
}
.add-new-column-content {
display: flex;
flex-direction: column;
padding-bottom: 16px;
min-height: 240px;
max-height: 400px;
.loading-container {
padding: 8px;
}
.column-format-new-options {
overflow-y: auto;
overflow-x: hidden;
.column-name {
padding: 4px 8px;
border-radius: 1px;
color: var(--l2-foreground);
&.selected {
background-color: var(--l3-background);
cursor: pointer;
}
}
&::-webkit-scrollbar {
height: 1rem;
width: 0.2rem;
}
}
}
}
.selected-item-content-container {
.add-new-column-header {
padding: 8px;
}
.title {
color: var(--l1-foreground);
margin-bottom: 12px;
display: flex;
justify-content: space-between;
align-items: center;
.lucide {
color: var(--l2-foreground);
cursor: pointer;
}
}
.horizontal-line {
height: 1px;
background: var(--l3-background);
}
.loading-container {
margin: 12px 0;
}
.item-content {
padding: 12px;
.column-format,
.column-format-new-options {
display: flex;
gap: 12px;
flex-direction: column;
margin-top: 12px;
.column-name {
color: var(--l2-foreground);
display: flex;
justify-content: space-between;
align-items: center;
gap: 8px;
cursor: pointer;
&.default-column {
color: var(--l2-foreground);
cursor: not-allowed;
}
&.no-columns-selected {
color: var(--l3-foreground);
cursor: not-allowed;
}
&.add-new-column-btn {
color: var(--l2-foreground);
cursor: pointer;
}
.name {
flex: 1;
overflow: hidden;
white-space: nowrap;
overflow: hidden;
cursor: pointer;
}
.delete-btn {
display: none;
flex: 0 0 16px;
cursor: pointer;
}
&:hover {
.delete-btn {
display: block;
}
}
}
overflow-x: hidden;
&::-webkit-scrollbar {
height: 1rem;
width: 0.2rem;
}
}
.column-format {
max-height: 150px;
overflow: auto;
overflow-x: hidden;
}
.column-format-new-options {
max-height: 150px;
overflow-y: auto;
overflow-x: hidden;
}
.column-divider {
margin: 12px 0;
border-top: 2px solid var(--l1-border);
}
}
}
&.active {
.nested-menu-container {
backdrop-filter: blur(18px);
@@ -368,26 +197,6 @@
}
}
}
.selected-item-content-container {
width: 110%;
margin-left: -5%;
border-radius: 4px;
border: 1px solid var(--l1-border);
background: linear-gradient(
139deg,
color-mix(in srgb, var(--surface-2) 80%, transparent) 0%,
color-mix(in srgb, var(--surface-2) 90%, transparent) 98.68%
);
box-shadow: 4px 10px 16px 2px rgba(0, 0, 0, 0.2);
backdrop-filter: blur(20px);
.column-format {
margin-top: 0px;
}
}
}
}
}

View File

@@ -26,9 +26,3 @@
width: max-content;
}
}
.select-label-with-coming-soon {
display: flex;
align-items: center;
justify-content: space-between;
}

View File

@@ -1,39 +1,8 @@
import { Color } from '@signozhq/design-tokens';
import { Tooltip } from 'antd';
import type { DefaultOptionType } from 'antd/es/select';
import { Info } from '@signozhq/icons';
import './MQCommon.styles.scss';
export function ComingSoon(): JSX.Element {
return (
<Tooltip
title={
<div>
Join our Slack community for more details:{' '}
<a
href="https://signoz.io/slack"
rel="noopener noreferrer"
target="_blank"
onClick={(e): void => e.stopPropagation()}
>
SigNoz Community
</a>
</div>
}
placement="top"
overlayClassName="tooltip-overlay"
>
<div className="coming-soon">
<div className="coming-soon__text">Coming Soon</div>
<div className="coming-soon__icon">
<Info size={10} color={Color.BG_SIENNA_400} />
</div>
</div>
</Tooltip>
);
}
export function SelectMaxTagPlaceholder(
omittedValues: Partial<DefaultOptionType>[],
): JSX.Element {
@@ -43,15 +12,3 @@ export function SelectMaxTagPlaceholder(
</Tooltip>
);
}
export function SelectLabelWithComingSoon({
label,
}: {
label: string;
}): JSX.Element {
return (
<div className="select-label-with-coming-soon">
{label} <ComingSoon />
</div>
);
}

View File

@@ -1,51 +1,3 @@
export const MOCK_USE_QUERIES_DATA = [
{
isLoading: false,
isError: false,
error: null,
data: {
statusCode: 200,
payload: [
{
exceptionType: '*errors.errorString',
exceptionMessage: 'redis timeout',
exceptionCount: 2510,
lastSeen: '2025-04-14T18:27:57.797616374Z',
firstSeen: '2025-04-14T17:58:00.262775497Z',
serviceName: 'redis-manual',
groupID: '511b9c91a92b9c5166ecb77235f5743b',
},
],
},
},
{
status: 'success',
isLoading: false,
isSuccess: true,
isError: false,
isIdle: false,
data: {
statusCode: 200,
error: null,
payload: 525,
},
dataUpdatedAt: 1744661020341,
error: null,
errorUpdatedAt: 0,
failureCount: 0,
errorUpdateCount: 0,
isFetched: true,
isFetchedAfterMount: true,
isFetching: false,
isRefetching: false,
isLoadingError: false,
isPlaceholderData: false,
isPreviousData: false,
isRefetchError: false,
isStale: true,
},
];
export const INIT_URL_WITH_COMMON_QUERY =
'/exceptions?compositeQuery=%257B%2522queryType%2522%253A%2522builder%2522%252C%2522builder%2522%253A%257B%2522queryData%2522%253A%255B%257B%2522dataSource%2522%253A%2522traces%2522%252C%2522queryName%2522%253A%2522A%2522%252C%2522aggregateOperator%2522%253A%2522noop%2522%252C%2522aggregateAttribute%2522%253A%257B%2522id%2522%253A%2522----resource--false%2522%252C%2522dataType%2522%253A%2522%2522%252C%2522key%2522%253A%2522%2522%252C%2522isColumn%2522%253Afalse%252C%2522type%2522%253A%2522resource%2522%252C%2522isJSON%2522%253Afalse%257D%252C%2522timeAggregation%2522%253A%2522rate%2522%252C%2522spaceAggregation%2522%253A%2522sum%2522%252C%2522functions%2522%253A%255B%255D%252C%2522filters%2522%253A%257B%2522items%2522%253A%255B%257B%2522id%2522%253A%2522db118ac7-9313-4adb-963f-f31b5b32c496%2522%252C%2522op%2522%253A%2522in%2522%252C%2522key%2522%253A%257B%2522key%2522%253A%2522deployment.environment%2522%252C%2522dataType%2522%253A%2522string%2522%252C%2522type%2522%253A%2522resource%2522%252C%2522isColumn%2522%253Afalse%252C%2522isJSON%2522%253Afalse%257D%252C%2522value%2522%253A%2522mq-kafka%2522%257D%255D%252C%2522op%2522%253A%2522AND%2522%257D%252C%2522expression%2522%253A%2522A%2522%252C%2522disabled%2522%253Afalse%252C%2522stepInterval%2522%253A60%252C%2522having%2522%253A%255B%255D%252C%2522limit%2522%253Anull%252C%2522orderBy%2522%253A%255B%255D%252C%2522groupBy%2522%253A%255B%255D%252C%2522legend%2522%253A%2522%2522%252C%2522reduceTo%2522%253A%2522avg%2522%257D%255D%252C%2522queryFormulas%2522%253A%255B%255D%257D%252C%2522promql%2522%253A%255B%257B%2522name%2522%253A%2522A%2522%252C%2522query%2522%253A%2522%2522%252C%2522legend%2522%253A%2522%2522%252C%2522disabled%2522%253Afalse%257D%255D%252C%2522clickhouse_sql%2522%253A%255B%257B%2522name%2522%253A%2522A%2522%252C%2522legend%2522%253A%2522%2522%252C%2522disabled%2522%253Afalse%252C%2522query%2522%253A%2522%2522%257D%255D%252C%2522id%2522%253A%2522dd576d04-0822-476d-b0c2-807a7af2e5e7%2522%257D';

View File

@@ -50,16 +50,6 @@
font-family: var(--code-base-500-font-family);
}
.radio-button {
display: flex;
align-items: center;
justify-content: center;
padding-top: var(--padding-1);
border: 1px solid var(--l1-border);
background: var(--l3-background);
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
}
.round-metric-tag {
display: inline-flex;
padding: 2px 8px;
@@ -783,80 +773,5 @@
gap: 12px;
cursor: pointer;
}
.no-dependent-services-message-container {
height: 30vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.no-dependent-services-message-content {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
width: fit-content;
padding: 24px;
}
.no-dependent-services-message {
margin-top: 8px;
}
}
}
}
.end-point-details-zero-state-wrapper {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 4px;
height: 100%;
.end-point-details-zero-state-content {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
gap: 4px;
height: 100%;
}
.end-point-details-zero-state-content-wrapper {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
gap: 12px;
.end-point-details-zero-state-text-content {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
gap: 8px;
.title {
color: var(--l1-foreground);
}
.description {
color: var(--l2-foreground);
}
}
.ant-select {
width: 100%;
}
}
.ant-select-item,
.ant-select-item-option-content {
flex: auto;
white-space: normal;
overflow-wrap: break-word;
}
}

View File

@@ -69,13 +69,6 @@ jest.mock('antd', () => {
))}
</div>
)),
Typography: {
Text: jest
.fn()
.mockImplementation(({ children }) => (
<div data-testid="typography-text">{children}</div>
)),
},
};
});

View File

@@ -130,13 +130,6 @@ jest.mock('antd', () => {
{children}
</div>
)),
Typography: {
Text: jest
.fn()
.mockImplementation(({ children }) => (
<div data-testid="typography-text">{children}</div>
)),
},
Button: {
...originalModule.Button,
Group: jest.fn().mockImplementation(({ children, className }) => (

View File

@@ -46,13 +46,6 @@ jest.mock('antd', () => {
)}
</div>
)),
Typography: {
Text: jest.fn().mockImplementation(({ children, className }) => (
<div data-testid="typography-text" className={className}>
{children}
</div>
)),
},
};
});

View File

@@ -1,16 +1,3 @@
import { domainNameKey } from './constants';
export interface APIMonitoringResponseRow {
data: {
endpoints: number | string;
error_rate: number | string;
lastseen: number | string;
[domainNameKey]: string;
p99: number | string;
rps: number | string;
};
}
export interface APIMonitoringResponseColumn {
name: string;
signal: string;
@@ -22,12 +9,6 @@ export interface APIMonitoringResponseColumn {
columnType: string;
}
export interface EndPointsResponseRow {
data: {
[key: string]: string | number | undefined;
};
}
export interface APIDomainsRowData {
key: string;
domainName: string;

View File

@@ -1,32 +1,24 @@
import { ReactNode } from 'react';
import { TableColumnType as ColumnType, Tooltip } from 'antd';
import { Progress } from '@signozhq/ui/progress';
import { Badge } from '@signozhq/ui/badge';
import { combineInitialAndUserExpression } from 'components/QueryBuilderV2/QueryV2/QuerySearch/utils';
import { formatValueForExpression } from 'components/QueryBuilderV2/utils';
import {
FiltersType,
IQuickFiltersConfig,
} from 'components/QuickFilters/types';
import { PANEL_TYPES } from 'constants/queryBuilder';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import { GraphClickMetaData } from 'container/WidgetCard/hooks/useNavigateToExplorerPages';
import { getWidgetQueryBuilder } from 'container/MetricsApplication/MetricsApplication.factory';
import { convertNanoToMilliseconds } from 'container/MetricsExplorer/Summary/utils';
import dayjs from 'dayjs';
import { GetQueryResultsProps } from 'lib/dashboard/getQueryResults';
import { cloneDeep } from 'lodash-es';
import { ArrowUpDown, ChevronDown, ChevronRight, Info } from '@signozhq/icons';
import { ArrowUpDown, Info } from '@signozhq/icons';
import { getWidgetQuery } from 'pages/MessagingQueues/MQDetails/MetricPage/MetricPageUtil';
import { Widgets } from 'types/api/widgets/widget';
import { MetricRangePayloadProps } from 'types/api/metrics/getQueryRange';
import {
BaseAutocompleteData,
DataTypes,
} from 'types/api/queryBuilder/queryAutocompleteResponse';
import {
IBuilderQuery,
OrderByPayload,
TagFilterItem,
} from 'types/api/queryBuilder/queryBuilderData';
import {
@@ -41,11 +33,7 @@ import { v4 } from 'uuid';
import { domainNameKey } from './constants';
import { SPAN_ATTRIBUTES } from './Explorer/Domains/DomainDetails/constants';
import {
APIDomainsRowData,
APIMonitoringResponseColumn,
EndPointsResponseRow,
} from './types';
import { APIDomainsRowData, APIMonitoringResponseColumn } from './types';
function metricProgressColor(
percent: number,
@@ -91,40 +79,6 @@ export const getDomainScopeExpression = (
.filter(Boolean)
.join(' AND ');
export const ApiMonitoringQuickFiltersConfig: IQuickFiltersConfig[] = [
{
type: FiltersType.CHECKBOX,
title: 'Environment',
attributeKey: {
key: 'deployment.environment',
dataType: DataTypes.String,
type: 'resource',
},
defaultOpen: true,
},
{
type: FiltersType.CHECKBOX,
title: 'Service Name',
attributeKey: {
key: 'service.name',
dataType: DataTypes.String,
type: 'resource',
},
defaultOpen: true,
},
{
type: FiltersType.CHECKBOX,
title: 'RPC Method',
attributeKey: {
key: 'rpc.method',
dataType: DataTypes.String,
type: 'tag',
},
defaultOpen: true,
},
];
export const getLastUsedRelativeTime = (lastRefresh: number): string => {
const currentTime = dayjs();
@@ -571,258 +525,6 @@ const defaultGroupBy = [
// },
];
export const getEndPointsQueryPayload = (
groupBy: BaseAutocompleteData[],
domainName: string,
start: number,
end: number,
): GetQueryResultsProps[] => {
const isGroupedByAttribute = groupBy.length > 0;
return [
{
selectedTime: 'GLOBAL_TIME',
graphType: PANEL_TYPES.TABLE,
query: {
builder: {
queryData: [
{
aggregateAttribute: {
dataType: DataTypes.String,
key: 'span_id',
type: '',
},
aggregateOperator: 'count',
dataSource: DataSource.TRACES,
disabled: false,
expression: 'A',
filters: {
items: [
{
id: 'ec316e57',
key: {
dataType: DataTypes.String,
key: SPAN_ATTRIBUTES.SERVER_NAME,
type: '',
},
op: '=',
value: domainName,
},
{
id: '212678b9',
key: {
key: 'kind_string',
dataType: DataTypes.String,
type: '',
},
op: '=',
value: 'Client',
},
],
op: 'AND',
},
functions: [],
groupBy: isGroupedByAttribute ? groupBy : defaultGroupBy,
having: [],
legend: '',
limit: 1000,
orderBy: [],
queryName: 'A',
reduceTo: ReduceOperators.AVG,
spaceAggregation: 'sum',
stepInterval: 60,
timeAggregation: 'count',
},
{
aggregateAttribute: {
dataType: DataTypes.Float64,
key: 'duration_nano',
type: '',
},
aggregateOperator: 'p99',
dataSource: DataSource.TRACES,
disabled: false,
expression: 'B',
filters: {
items: [
{
id: '46d57857',
key: {
dataType: DataTypes.String,
key: SPAN_ATTRIBUTES.SERVER_NAME,
type: '',
},
op: '=',
value: domainName,
},
{
id: '212678b9',
key: {
key: 'kind_string',
dataType: DataTypes.String,
type: '',
},
op: '=',
value: 'Client',
},
],
op: 'AND',
},
functions: [],
groupBy: isGroupedByAttribute ? groupBy : defaultGroupBy,
having: [],
legend: '',
limit: 1000,
orderBy: [],
queryName: 'B',
reduceTo: ReduceOperators.AVG,
spaceAggregation: 'sum',
stepInterval: 60,
timeAggregation: 'p99',
},
{
aggregateAttribute: {
dataType: DataTypes.String,
id: 'timestamp------false',
key: 'timestamp',
type: '',
},
aggregateOperator: 'max',
dataSource: DataSource.TRACES,
disabled: false,
expression: 'C',
filters: {
items: [
{
id: '4a237616',
key: {
dataType: DataTypes.String,
key: SPAN_ATTRIBUTES.SERVER_NAME,
type: '',
},
op: '=',
value: domainName,
},
{
id: '212678b9',
key: {
key: 'kind_string',
dataType: DataTypes.String,
type: '',
},
op: '=',
value: 'Client',
},
],
op: 'AND',
},
functions: [],
groupBy: isGroupedByAttribute ? groupBy : defaultGroupBy,
having: [],
legend: '',
limit: 1000,
orderBy: [],
queryName: 'C',
reduceTo: ReduceOperators.AVG,
spaceAggregation: 'sum',
stepInterval: 60,
timeAggregation: 'max',
},
{
aggregateAttribute: {
dataType: DataTypes.String,
key: 'span_id',
type: '',
},
aggregateOperator: 'count',
dataSource: DataSource.TRACES,
disabled: true,
expression: 'D',
filters: {
items: [
{
id: 'f162de1e',
key: {
dataType: DataTypes.String,
key: SPAN_ATTRIBUTES.SERVER_NAME,
type: '',
},
op: '=',
value: domainName,
},
{
id: '3df0ac1d',
key: {
dataType: DataTypes.bool,
key: 'has_error',
type: '',
},
op: '=',
value: 'true',
},
{
id: '212678b9',
key: {
key: 'kind_string',
dataType: DataTypes.String,
type: '',
},
op: '=',
value: 'Client',
},
],
op: 'AND',
},
functions: [],
groupBy: isGroupedByAttribute ? groupBy : defaultGroupBy,
having: [],
legend: '',
limit: 1000,
orderBy: [],
queryName: 'D',
reduceTo: ReduceOperators.AVG,
spaceAggregation: 'sum',
stepInterval: 60,
timeAggregation: 'count',
},
],
queryFormulas: [
{
queryName: 'F1',
expression: '(D/A)*100',
disabled: false,
legend: 'error percentage',
},
],
queryTraceOperator: [],
},
clickhouse_sql: [
{
disabled: false,
legend: '',
name: 'A',
query: '',
},
],
id: '315b15fa-ff0c-442f-89f8-2bf4fb1af2f2',
promql: [
{
disabled: false,
legend: '',
name: 'A',
query: '',
},
],
queryType: EQueryType.QUERY_BUILDER,
},
variables: {},
formatForWeb: true,
start,
end,
step: 60,
},
];
};
function buildFilterExpression(
domainName: string,
filterExpression: string,
@@ -907,16 +609,6 @@ export const getTopErrorsQueryPayload = (
};
};
export interface EndPointsTableRowData {
key: string;
endpointName: string;
callCount: number | string;
latency: number | string;
errorRate: number | string;
lastUsed: string | number;
groupedByMeta?: Record<string, string | number>;
}
export const extractPortAndEndpoint = (
url: string,
): { port: string; endpoint: string } => {
@@ -937,258 +629,6 @@ export const extractPortAndEndpoint = (
}
};
export const getEndPointsColumnsConfig = (
isGroupedByAttribute: boolean,
expandedRowKeys: React.Key[],
// eslint-disable-next-line sonarjs/cognitive-complexity
): ColumnType<EndPointsTableRowData>[] => [
{
title: (
<div className="endpoint-name-header">
{isGroupedByAttribute ? 'Endpoint group' : 'Endpoint'}
</div>
),
dataIndex: 'endpointName',
key: 'endpointName',
width: 180,
ellipsis: true,
sorter: false,
className: 'column',
render: (text: string, record: EndPointsTableRowData): React.ReactNode => {
const endPointName = isGroupedByAttribute
? text
: extractPortAndEndpoint(record.endpointName).endpoint;
return (
<div className="endpoint-name-value">
{((): React.ReactNode => {
if (!isGroupedByAttribute) {
return null;
}
return expandedRowKeys.includes(record.key) ? (
<ChevronDown size={14} />
) : (
<ChevronRight size={14} />
);
})()}
{isGroupedByAttribute
? text.split(',').map((value) => (
<Badge
textTransform="none"
variant="solid"
key={value}
color="secondary"
>
{value === '' ? '<no-value>' : value}
</Badge>
))
: endPointName}
</div>
);
},
},
{
title: <div className="column-header">Port</div>,
dataIndex: 'port',
key: 'port',
width: 180,
ellipsis: true,
sorter: false,
align: 'right',
className: `column`,
},
{
title: (
<div className="column-header">
Num of calls <ArrowUpDown size={14} />
</div>
),
dataIndex: 'callCount',
key: 'callCount',
width: 180,
ellipsis: true,
align: 'right',
className: `column`,
},
{
title: (
<div>
Error <span className="round-metric-tag">%</span>
</div>
),
dataIndex: 'errorRate',
key: 'errorRate',
width: 120,
sorter: true,
align: 'right',
className: `column`,
render: (errorRate: number | string): React.ReactNode => (
<div className="progress-bar error-rate">
<Progress
percent={Number(
(
(errorRate === 'n/a' || errorRate === '-' ? 0 : errorRate) as number
).toFixed(1),
)}
showInfo
color={metricProgressColor(
Number(
(
(errorRate === 'n/a' || errorRate === '-' ? 0 : errorRate) as number
).toFixed(1),
),
)}
/>
</div>
),
},
{
title: (
<div>
Latency <span className="round-metric-tag">ms</span>
</div>
),
dataIndex: 'latency',
key: 'latency',
width: 120,
sorter: true,
align: 'right',
className: `column`,
},
{
title: <div>Last used</div>,
dataIndex: 'lastUsed',
key: 'lastUsed',
width: 120,
sorter: true,
align: 'right',
className: `column`,
// eslint-disable-next-line sonarjs/no-identical-functions
render: (lastUsed: string): string =>
lastUsed === 'n/a' || lastUsed === '-'
? '-'
: getLastUsedRelativeTime(new Date(lastUsed).getTime()),
},
];
export const formatEndPointsDataForTable = (
data: EndPointsResponseRow[] | undefined,
groupBy: BaseAutocompleteData[],
orderBy?: OrderByPayload | null,
// eslint-disable-next-line sonarjs/cognitive-complexity
): EndPointsTableRowData[] => {
if (!data) {
return [];
}
const isGroupedByAttribute = groupBy.length > 0;
let formattedData: EndPointsTableRowData[] = [];
if (!isGroupedByAttribute) {
formattedData = data?.map((endpoint) => {
const { port } = extractPortAndEndpoint(
(endpoint.data[SPAN_ATTRIBUTES.HTTP_URL] as string) || '',
);
return {
key: v4(),
endpointName: (endpoint.data[SPAN_ATTRIBUTES.HTTP_URL] as string) || '-',
port,
callCount:
endpoint.data.A === 'n/a' || endpoint.data.A === undefined
? '-'
: endpoint.data.A,
latency:
endpoint.data.B === 'n/a' || endpoint.data.B === undefined
? '-'
: Math.round(Number(endpoint.data.B) / 1000000), // Convert from nanoseconds to milliseconds
lastUsed:
endpoint.data.C === 'n/a' || endpoint.data.C === undefined
? '-'
: new Date(Math.floor(Number(endpoint.data.C) / 1000000)).toISOString(), // Convert from nanoseconds to milliseconds
errorRate:
endpoint.data.F1 === undefined || endpoint.data.F1 === 'n/a'
? 0
: Number(endpoint.data.F1),
};
});
} else {
const groupedByAttributeData = groupBy.map((attribute) => attribute.key);
formattedData = data?.map((endpoint) => {
const newEndpointName = groupedByAttributeData
.map((attribute) => endpoint.data[attribute])
.join(',');
return {
key: v4(),
endpointName: newEndpointName,
callCount:
endpoint.data.A === 'n/a' || endpoint.data.A === undefined
? '-'
: endpoint.data.A,
latency:
endpoint.data.B === 'n/a' || endpoint.data.B === undefined
? '-'
: Math.round(Number(endpoint.data.B) / 1000000), // Convert from nanoseconds to milliseconds
lastUsed:
endpoint.data.C === 'n/a' || endpoint.data.C === undefined
? '-'
: getLastUsedRelativeTime(Math.floor(Number(endpoint.data.C) / 1000000)), // Convert from nanoseconds to milliseconds
errorRate:
endpoint.data.D === 'n/a' || endpoint.data.D === undefined
? 0
: Number(endpoint.data.D),
groupedByMeta: groupedByAttributeData.reduce(
(acc, attribute) => {
acc[attribute] = endpoint.data[attribute] || '';
return acc;
},
{} as Record<string, string | number>,
),
};
});
}
// Apply sorting if orderBy is provided
if (orderBy) {
formattedData.sort((a, b) => {
let valueA: number | string = a[
orderBy.columnName as keyof EndPointsTableRowData
] as number | string;
let valueB: number | string = b[
orderBy.columnName as keyof EndPointsTableRowData
] as number | string;
// Handle special cases for each column type
if (
orderBy.columnName === 'callCount' ||
orderBy.columnName === 'latency' ||
orderBy.columnName === 'errorRate'
) {
valueA = valueA === '-' || valueA === 'n/a' ? 0 : Number(valueA);
valueB = valueB === '-' || valueB === 'n/a' ? 0 : Number(valueB);
} else if (orderBy.columnName === 'lastUsed') {
// confirm once the implication of this
valueA =
valueA === '-' || valueA === 'n/a'
? new Date(0).getTime()
: new Date(valueA as string).getTime();
valueB =
valueB === '-' || valueB === 'n/a'
? new Date(0).getTime()
: new Date(valueB as string).getTime();
}
// Apply sort direction
if (orderBy.order === 'asc') {
return valueA > valueB ? 1 : -1;
}
return valueA < valueB ? 1 : -1;
});
}
return formattedData;
};
export type TopErrorsResponseRow = ScalarData;
export interface TopErrorsTableRowData {
@@ -1333,37 +773,6 @@ export const getTopErrorsColumnsConfig =
},
];
export const createFiltersForSelectedRowData = (
selectedRowData: EndPointsTableRowData,
currentFilters?: IBuilderQuery['filters'],
): IBuilderQuery['filters'] => {
const baseFilters: IBuilderQuery['filters'] = {
items: [...(currentFilters?.items || [])],
op: 'and',
};
if (!selectedRowData) {
return baseFilters;
}
const { groupedByMeta = {} } = selectedRowData;
// Replace for...of with Object.keys().map()
baseFilters.items.push(
...Object.keys(groupedByMeta).map((key) => ({
key: {
key,
type: null,
},
op: '=',
value: groupedByMeta[key] || '',
id: key,
})),
);
return baseFilters;
};
// First query payload for endpoint metrics
// Second query payload for endpoint status code table
// Third query payload for endpoint dependant services
@@ -2465,21 +1874,6 @@ export const dependentServicesColumns: ColumnType<DependentServicesData>[] = [
},
];
export const getFormattedChartData = (
data: MetricRangePayloadProps,
newLegendArray: string[],
): MetricRangePayloadProps => {
const result = cloneDeep(data);
if (result?.data?.result) {
result.data.result = result?.data?.result?.map((series, index) => ({
...series,
legend: newLegendArray[index],
}));
}
return result;
};
const getStatusCodeClass = (statusCode: string): string => {
const code = parseInt(statusCode, 10);
@@ -3100,40 +2494,6 @@ const getStartAndEndStatusCode = (
}
};
/**
* Creates filter items for bar chart based on group by fields and request data
* Used specifically for filtering status code ranges in bar charts
* @param groupBy Array of group by fields to create filters for
* @param requestData Data from graph click containing values to filter on
* @returns Array of TagFilterItems with >= and < operators for status code ranges
*/
export const createGroupByFiltersForBarChart = (
groupBy: BaseAutocompleteData[],
requestData: GraphClickMetaData,
): TagFilterItem[] =>
groupBy
.map((gb) => {
const value = requestData[gb.key];
const [startStatusCode, endStatusCode] = getStartAndEndStatusCode(value);
return value
? [
{
id: v4(),
key: gb,
op: '>=',
value: startStatusCode,
},
{
id: v4(),
key: gb,
op: '<=',
value: endStatusCode,
},
]
: [];
})
.flat();
export const getCustomFiltersForBarChart = (
metric:
| {

View File

@@ -13,11 +13,6 @@ export const DashedContainer = styled.div`
align-items: center;
`;
export const ButtonContainer = styled.div`
display: flex;
gap: 1rem;
`;
export const EventContainer = styled.div`
display: flex;
justify-content: space-between;

View File

@@ -42,10 +42,6 @@
align-items: flex-start;
flex-direction: column;
.ant-typography {
color: var(--l1-foreground);
}
.loading-gif {
height: 72px;
margin-left: -24px;

View File

@@ -3,10 +3,6 @@ import {
initialQueryBuilderFormValuesMap,
} from 'constants/queryBuilder';
import { ORDERBY_FILTERS } from 'container/QueryBuilder/filters/OrderByFilter/config';
import {
BaseAutocompleteData,
DataTypes,
} from 'types/api/queryBuilder/queryAutocompleteResponse';
import { IBuilderQuery, Query } from 'types/api/queryBuilder/queryBuilderData';
import { LogsAggregatorOperator } from 'types/common/queryBuilder';
@@ -44,9 +40,3 @@ export const liveLogsCompositeQuery = constructCompositeQuery({
initialQueryData: initialQueryBuilderFormValuesMap.logs,
customQueryData: defaultLiveQueryDataConfig,
});
export const idObject: BaseAutocompleteData = {
key: 'id',
type: '',
dataType: DataTypes.String,
};

View File

@@ -1,35 +0,0 @@
.json-view-container {
border-radius: 3px;
border: 1px solid var(--l1-border);
padding-top: 16px;
.json-view-footer {
height: 36px;
display: flex;
align-items: center;
border-top: 1px solid var(--l1-border);
}
.log-switch {
display: flex;
justify-content: space-between;
align-items: center;
.wrap-word-switch {
display: flex;
gap: 8px;
margin-left: var(--margin-3);
align-items: center;
}
.log-switch-btn {
border: 1px solid var(--l1-border);
background-color: var(--l2-background);
width: 40px;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
}
}

View File

@@ -35,13 +35,6 @@
display: flex;
align-items: center;
.wrap-word-switch {
display: flex;
gap: 8px;
margin-left: var(--margin-3);
align-items: center;
}
.log-switch-btn {
border: 1px solid var(--l1-border);
background-color: var(--l2-background);
@@ -53,74 +46,12 @@
}
}
.attribute-table {
margin-top: var(--margin-1);
}
.ant-collapse {
border: 1px solid var(--l1-border);
}
.collapse-content {
border-bottom: 1px solid var(--l1-border);
.ant-collapse-header {
align-items: center;
border-radius: 2px;
background-color: var(--l3-background);
border: 1px solid var(--l3-border);
padding: 8px;
.ant-collapse-extra {
display: flex;
align-items: center;
.action-btn {
display: flex;
.ant-btn {
background: color-mix(in srgb, var(--bg-robin-400) 8%, transparent);
}
}
}
}
.ant-collapse-content {
padding: 0;
background: var(--l2-background);
border-top: 1px solid var(--l1-border);
.ant-collapse-content-box {
padding: var(--padding-2) 0 0 0;
}
}
}
.logs-body-content {
padding-top: 12px;
}
[data-slot='badge'] {
border-radius: 2px;
background: color-mix(in srgb, var(--bg-robin-400) 8%, transparent);
}
.attribute-collapse {
.ant-collapse-content {
.ant-collapse-content-box {
padding: 0;
}
}
}
.ant-table-wrapper .ant-table-cell {
padding: 14px 14px;
}
.attribute-tab-header {
display: flex;
align-items: center;
justify-content: space-between;
}
}

View File

@@ -1,5 +0,0 @@
export const DROPDOWN_KEY = {
FILTER_IN: 'filterIn',
FILTER_OUT: 'filterOut',
GROUP_BY: 'groupBy',
};

View File

@@ -76,9 +76,6 @@ export const generateFieldKeyForArray = (
return `body.${newResultNodeKey}`;
};
export const removeObjectFromString = (str: string): string =>
str.replace(/\[object Object\]./g, '');
// Split `str` on the first occurrence of `delimiter`
// For example, will return `['a', 'b.c']` when splitting `'a.b.c'` at dots
const splitOnce = (str: string, delimiter: string): string[] => {
@@ -303,30 +300,6 @@ export const unescapeString = (str: string): string =>
String.fromCharCode(parseInt(hex, 16)),
); // Replaces Unicode escape sequences
export function findKeyPath(
obj: AnyObject,
targetKey: string,
currentPath = '',
): string | null {
let finalPath = null;
Object.keys(obj).forEach((key) => {
const value = obj[key];
const newPath = currentPath ? `${currentPath}.${key}` : key;
if (key === targetKey) {
finalPath = newPath;
}
if (typeof value === 'object' && value !== null) {
const result = findKeyPath(value, targetKey, newPath);
if (result) {
finalPath = result;
}
}
});
return finalPath;
}
export const getSanitizedLogBody = (
text: string,
options: { shouldEscapeHtml?: boolean } = {},

View File

@@ -1,10 +0,0 @@
.qb-search-view-container {
padding: 8px 16px;
.ant-select-selector {
border-radius: 2px;
border: 1px solid var(--l1-border) !important;
background-color: var(--l1-background) !important;
color: var(--l2-foreground);
}
}

View File

@@ -7,8 +7,6 @@ import { useShareBuilderUrl } from 'hooks/queryBuilder/useShareBuilderUrl';
import { ExplorerViews } from 'pages/LogsExplorer/utils';
import { DataSource } from 'types/common/queryBuilder';
import './LogsExplorerQuerySection.styles.scss';
function LogExplorerQuerySection({
selectedView,
}: {

View File

@@ -62,16 +62,6 @@ const SEVERITY_VARIANT_COLORS: Record<string, string> = {
PANIC: Color.BG_SAKURA_600,
};
// Simple function to get severity color for any component
export function getSeverityColor(severityText: string): string {
const variantColor = SEVERITY_VARIANT_COLORS[severityText.trim()];
if (variantColor) {
return variantColor;
}
return Color.BG_ROBIN_500; // Default fallback
}
export function getColorsForSeverityLabels(
label: string,
index: number,

View File

@@ -7,252 +7,6 @@
letter-spacing: -0.005em;
text-align: left;
min-height: 0;
.logs-list-table-view-container {
.data-table-container {
border: none !important;
}
table {
thead {
tr {
th {
font-size: 12px;
color: white !important;
.cursor-col-resize {
width: 24px !important;
cursor: col-resize !important;
opacity: 1 !important;
background-color: transparent !important;
border: none !important;
&:hover {
opacity: 1 !important;
}
}
}
td {
font-size: 12px;
}
border-bottom: 1px solid var(--l1-border) !important;
}
border-bottom: 1px solid var(--l1-border) !important;
background-color: var(--l2-background) !important;
tr {
&:hover {
background-color: var(--l2-background) !important;
}
}
}
tbody {
tr {
td {
font-size: 12px;
padding: 4px !important;
white-space: pre-wrap !important;
overflow: hidden !important;
}
&:hover {
background-color: var(--l1-border) !important;
}
border-bottom: 1px solid var(--l1-border) !important;
}
tr:has(.active-log) {
background-color: rgba(78, 116, 248, 0.5) !important; // same as bg-robin-500
color: var(--l1-foreground) !important;
}
}
thead {
z-index: 2 !important;
}
.log-state-indicator {
padding-left: 0 !important;
.line {
margin: 0 0 !important;
}
}
}
.sticky-header-table-container {
&::-webkit-scrollbar {
width: 0.4rem;
height: 0.4rem;
}
&::-webkit-scrollbar-track {
background: transparent;
}
&::-webkit-scrollbar-thumb {
background: var(--l3-background);
}
&::-webkit-scrollbar-thumb:hover {
background: var(--l3-background);
}
}
&[data-max-lines-per-row='1'] {
tbody {
tr {
td {
.table-cell-content {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
}
}
}
}
&[data-max-lines-per-row='2'] {
tbody {
tr {
td {
.table-cell-content {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
}
}
}
}
&[data-max-lines-per-row='3'] {
tbody {
tr {
td {
.table-cell-content {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
}
}
}
}
}
&[data-max-lines-per-row='4'] {
tbody {
tr {
td {
.table-cell-content {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 4;
overflow: hidden;
}
}
}
}
}
&[data-max-lines-per-row='5'] {
tbody {
tr {
td {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 5;
overflow: hidden;
}
}
}
}
&[data-max-lines-per-row='6'] {
tbody {
tr {
td {
.table-cell-content {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 6;
overflow: hidden;
}
}
}
}
}
&[data-max-lines-per-row='7'] {
tbody {
tr {
td {
.table-cell-content {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 7;
overflow: hidden;
}
}
}
}
}
&[data-max-lines-per-row='8'] {
tbody {
tr {
td {
.table-cell-content {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 8;
overflow: hidden;
}
}
}
}
}
&[data-max-lines-per-row='9'] {
tbody {
tr {
td {
.table-cell-content {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 9;
overflow: hidden;
}
}
}
}
}
&[data-max-lines-per-row='10'] {
tbody {
tr {
td {
.table-cell-content {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 10;
overflow: hidden;
}
}
}
}
}
}
}
.logs-linked-row td {

View File

@@ -132,16 +132,6 @@
align-items: center;
gap: 4px;
}
.order-by-select {
width: 100px;
.ant-select-selector {
border: none;
box-shadow: none;
background-color: transparent;
}
}
}
}

View File

@@ -20,17 +20,6 @@
font-weight: 400;
line-height: 18px;
font-family: Inter;
.ant-typography {
background-color: transparent;
color: var(--l1-foreground);
margin-bottom: 0;
font-size: 13px;
font-style: normal;
font-weight: 400;
line-height: 18px;
font-family: Inter;
}
padding: 14px 8px;
border: none;
cursor: pointer;

View File

@@ -29,15 +29,6 @@ export const ProcessorTypeContainer = styled.div`
gap: 0.313rem;
`;
export const Container = styled.div`
display: flex;
flex-direction: row;
align-items: flex-start;
padding: 0rem;
gap: 1rem;
width: 100%;
`;
export const FormWrapper = styled.div`
width: 100%;
`;

View File

@@ -1,7 +0,0 @@
.sample-logs-notice-container {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}

View File

@@ -1,24 +0,0 @@
import { Badge } from '@signozhq/ui/badge';
function Tags({ tags }: TagsProps): JSX.Element {
return (
<span>
{tags?.map((tag) => (
<Badge
textTransform="none"
variant="solid"
color="highlight-danger"
key={tag}
>
{tag}
</Badge>
))}
</span>
);
}
interface TagsProps {
tags: Array<string>;
}
export default Tags;

View File

@@ -2,8 +2,6 @@ import { Pipeline, PipelineData } from 'types/api/pipeline/def';
import { DataTypes } from 'types/api/queryBuilder/queryAutocompleteResponse';
import { TagFilter } from 'types/api/queryBuilder/queryBuilderData';
export const configurationVersion = '1.0';
export function mockPipelineFilter(
key: string,
op: string,

View File

@@ -1,11 +0,0 @@
import Tags from 'container/PipelinePage/PipelineListsView/TableComponents/Tags';
import { render } from 'tests/test-utils';
const tags = ['server', 'app'];
describe('PipelinePage container test', () => {
it('should render Tags section', () => {
const { asFragment } = render(<Tags tags={tags} />);
expect(asFragment()).toMatchSnapshot();
});
});

View File

@@ -1,42 +0,0 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`PipelinePage container test should render Tags section 1`] = `
<DocumentFragment>
<span>
<span
class="_badge_1wurm_1"
data-color="highlight-danger"
data-slot="badge"
data-text-overflow="ellipsis"
data-text-transform="none"
data-trigger-disabled=""
data-variant="solid"
id="base-ui-:r1:"
>
<span
class="_badge__label_1wurm_141"
data-slot="badge-label"
>
server
</span>
</span>
<span
class="_badge_1wurm_1"
data-color="highlight-danger"
data-slot="badge"
data-text-overflow="ellipsis"
data-text-transform="none"
data-trigger-disabled=""
data-variant="solid"
id="base-ui-:r3:"
>
<span
class="_badge__label_1wurm_141"
data-slot="badge-label"
>
app
</span>
</span>
</span>
</DocumentFragment>
`;

View File

@@ -1,12 +1,5 @@
import { CSSProperties } from 'react';
import styled from 'styled-components';
export const tableStyles: CSSProperties = {
cursor: 'unset',
};
export const Container = styled.div`
display: flex;
flex-direction: column;
--typography-color: var(--l1-foreground);
`;

View File

@@ -3,11 +3,6 @@ import { ScalarFieldValue } from 'utils/stringUtils';
import { ILog } from 'types/api/logs/log';
import { DataTypes } from 'types/api/queryBuilder/queryAutocompleteResponse';
export type LogTimeRange = {
start: number;
end: number;
};
export type UseCopyLogLink = {
isHighlighted: boolean;
isLogsExplorerPage: boolean;

View File

@@ -289,31 +289,6 @@ export const apiMonitoringMocks = defineStoryMocks({
}),
),
rest.get(
'http://localhost/api/v3/autocomplete/attribute_keys',
response.json((req) => ({
status: 'success',
data: {
attributeKeys: groupByAttributeKeys(
req.url.searchParams.get('searchText') ?? '',
),
},
})),
),
rest.get(
'http://localhost/api/v3/autocomplete/attribute_values',
response.json((req) => ({
status: 'success',
data: {
boolAttributeValues: null,
numberAttributeValues: null,
stringAttributeValues:
QUICK_FILTER_VALUES[req.url.searchParams.get('attributeKey') ?? ''] ?? [],
},
})),
),
rest.get(
'http://localhost/api/v1/fields/keys',
response.json((req) =>

View File

@@ -1,8 +1,3 @@
import {
FiltersType,
IQuickFiltersConfig,
} from 'components/QuickFilters/types';
import { DataTypes } from 'types/api/queryBuilder/queryAutocompleteResponse';
import { Query } from 'types/api/queryBuilder/queryBuilderData';
export const prepareQueryWithDefaultTimestamp = (query: Query): Query => ({
@@ -23,88 +18,3 @@ export enum ExplorerViews {
TABLE = 'table',
CLICKHOUSE = 'clickhouse',
}
export const LogsQuickFiltersConfig: IQuickFiltersConfig[] = [
{
type: FiltersType.CHECKBOX,
title: 'Severity Text',
attributeKey: {
key: 'severity_text',
dataType: DataTypes.String,
type: '',
id: 'severity_text--string----true',
},
defaultOpen: true,
},
{
type: FiltersType.CHECKBOX,
title: 'Environment',
attributeKey: {
key: 'deployment.environment',
dataType: DataTypes.String,
type: 'resource',
},
defaultOpen: false,
},
{
type: FiltersType.CHECKBOX,
title: 'Service Name',
attributeKey: {
key: 'service.name',
dataType: DataTypes.String,
type: 'resource',
id: 'service.name--string--resource--true',
},
defaultOpen: false,
},
{
type: FiltersType.CHECKBOX,
title: 'Hostname',
attributeKey: {
key: 'host.name',
dataType: DataTypes.String,
type: 'resource',
},
defaultOpen: false,
},
{
type: FiltersType.CHECKBOX,
title: 'K8s Cluster Name',
attributeKey: {
key: 'k8s.cluster.name',
dataType: DataTypes.String,
type: 'resource',
},
defaultOpen: false,
},
{
type: FiltersType.CHECKBOX,
title: 'K8s Deployment Name',
attributeKey: {
key: 'k8s.deployment.name',
dataType: DataTypes.String,
type: 'resource',
},
defaultOpen: false,
},
{
type: FiltersType.CHECKBOX,
title: 'K8s Namespace Name',
attributeKey: {
key: 'k8s.namespace.name',
dataType: DataTypes.String,
type: 'resource',
},
defaultOpen: false,
},
{
type: FiltersType.CHECKBOX,
title: 'K8s Pod Name',
attributeKey: {
key: 'k8s.pod.name',
dataType: DataTypes.String,
type: 'resource',
},
defaultOpen: false,
},
];

View File

@@ -28,7 +28,6 @@ import type { PageStoryArgs } from '@/storybook/runtime/resolveStory';
import { logsSavedViewsResponse } from '../../stories/__story_mockdata__/savedViews';
import {
attributeValuesResponse,
dashboardsResponse,
infraMetricsResponse,
logFieldKeysResponse,
@@ -200,16 +199,6 @@ export const liveLogsMocks = defineStoryMocks({
),
),
rest.get(
'http://localhost/api/v3/autocomplete/attribute_values',
response.json((req) =>
attributeValuesResponse(
req.url.searchParams.get('attributeKey') ?? '',
req.url.searchParams.get('searchText') ?? '',
),
),
),
rest.get(
'http://localhost/api/v2/saved_views',
response.json(() => logsSavedViewsResponse(4)),

View File

@@ -37,7 +37,6 @@ import {
SAVED_VIEW_MAX,
} from './__story_mockdata__/savedViews';
import {
attributeValuesResponse,
dashboardsResponse,
INFRA_RESOURCES,
type InfraResource,
@@ -287,16 +286,6 @@ export const logsMocks = defineStoryMocks({
),
),
rest.get(
'http://localhost/api/v3/autocomplete/attribute_values',
response.json((req) =>
attributeValuesResponse(
req.url.searchParams.get('attributeKey') ?? '',
req.url.searchParams.get('searchText') ?? '',
),
),
),
rest.get(
'http://localhost/api/v2/saved_views',
response.json(() => logsSavedViewsResponse(values.savedViews)),

View File

@@ -24,7 +24,6 @@ import { quickFiltersListResponse } from 'mocks-server/__mockdata__/customQuickF
import type { AppState } from 'store/reducers';
import type { Warning } from 'types/api';
import type { ILogBody } from 'types/api/logs/log';
import type { IAttributeValuesResponse } from 'types/api/queryBuilder/getAttributesValues';
import { DataTypes } from 'types/api/queryBuilder/queryAutocompleteResponse';
import type {
Query,
@@ -504,28 +503,6 @@ export const logFieldValuesResponse = (
},
});
/**
* The quick filters read values off the v3 autocomplete endpoint rather than
* `/fields/values`, and it answers numbers as strings.
*/
export const attributeValuesResponse = (
attributeKey: string,
searchText: string,
): { status: string; data: IAttributeValuesResponse } => ({
status: 'success',
data: {
stringAttributeValues: matching(
STRING_VALUES[attributeKey] ?? [],
searchText,
),
numberAttributeValues: matching(
NUMBER_VALUES[attributeKey] ?? [],
searchText,
).map(String),
boolAttributeValues: null,
},
});
/**
* The list's own options: the loader reads localStorage ahead of the URL, so
* this is what decides the format, and the columns have to be in it or the list

View File

@@ -54,10 +54,6 @@
padding: 24px;
border: 1px solid var(--l1-border);
border-radius: 6px;
.ant-typography {
font-size: 14px;
}
}
}

View File

@@ -46,11 +46,6 @@
align-items: center;
height: 48px !important;
.ant-typography {
font-size: 14px;
font-weight: 500;
}
.row-panel-section {
display: flex;
gap: 6px;

View File

@@ -177,73 +177,5 @@
.summary-section {
display: flex;
.summary-card {
display: flex;
padding: 12px;
flex-direction: column;
align-items: flex-start;
border: 1px solid var(--l1-border);
background: var(--l2-background);
width: 337px;
height: 283px;
border-radius: 2px;
.summary-title {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
height: 24px;
> p {
color: var(--l2-foreground);
margin: 0;
}
.time-value {
display: flex;
gap: 4px;
align-items: center;
> p {
color: var(--l3-foreground);
}
}
}
.view-detail-btn {
height: 100%;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
}
}
.coming-soon-card {
background: var(--l1-background) !important;
border-left: none !important;
}
}
.overview-confirm-modal {
background-color: var(--l1-background);
padding: 0;
border-radius: 4px;
.ant-modal-content {
background-color: var(--l3-background);
.ant-modal-confirm-content {
color: var(--l1-foreground);
}
.ant-modal-confirm-body-wrapper {
display: flex;
flex-direction: column;
height: 150px;
justify-content: space-between;
}
}
}

View File

@@ -5,7 +5,6 @@ import {
} from 'api/messagingQueues/getConsumerLagDetails';
import { getPartitionLatencyDetails } from 'api/messagingQueues/getPartitionLatencyDetails';
import { getTopicThroughputDetails } from 'api/messagingQueues/getTopicThroughputDetails';
import { OnboardingStatusResponse } from 'api/messagingQueues/onboarding/getOnboardingStatus';
import { QueryParams } from 'constants/query';
import { PANEL_TYPES } from 'constants/queryBuilder';
import { GetWidgetQueryBuilderProps } from 'container/MetricsApplication/types';
@@ -164,9 +163,6 @@ export function getWidgetQuery({
};
}
export const convertToNanoseconds = (timestamp: number): bigint =>
BigInt((timestamp * 1e9).toFixed(0));
export const getCustomTimeRangeWindowSweepInMS = (
customTimeRangeWindowForCoRelation: string | undefined,
): number => {
@@ -349,42 +345,6 @@ export const getMetaDataAndAPIPerView = (
};
};
interface OnboardingStatusAttributeData {
overallStatus: string;
allAvailableAttributes: string[];
attributeDataWithError: { attributeName: string; errorMsg: string }[];
}
export const getAttributeDataFromOnboardingStatus = (
onboardingStatus?: OnboardingStatusResponse | null,
): OnboardingStatusAttributeData => {
const allAvailableAttributes: string[] = [];
const attributeDataWithError: {
attributeName: string;
errorMsg: string;
}[] = [];
if (onboardingStatus?.data && !isEmpty(onboardingStatus?.data)) {
onboardingStatus.data.forEach((status) => {
if (status.attribute) {
allAvailableAttributes.push(status.attribute);
if (status.status === '0') {
attributeDataWithError.push({
attributeName: status.attribute,
errorMsg: status.error_message || '',
});
}
}
});
}
return {
overallStatus: attributeDataWithError.length ? 'error' : 'success',
allAvailableAttributes,
attributeDataWithError,
};
};
export enum MessagingQueueHealthCheckService {
Consumers = 'consumers',
Producers = 'producers',

View File

@@ -19,11 +19,6 @@
color: var(--l1-foreground);
}
// Typography sets size, weight and line height; the mixin adds the rest.
.roleLabel {
@include paragraph-base;
}
.parts {
display: flex;
flex-direction: column;

View File

@@ -37,8 +37,6 @@ export type MessagePart =
// The API's generic part is an untyped index signature, which defeats narrowing on `type`.
| { type: 'generic'; content?: unknown };
export type MessagePartType = MessagePart['type'];
export type MediaMessagePart = Extract<
MessagePart,
{ type: 'blob' | 'file' | 'uri' }

View File

@@ -1,7 +1,3 @@
.root {
position: relative;
}
.toggle {
display: inline-flex;
align-items: center;

View File

@@ -14,11 +14,6 @@ interface SpanReference {
refType: string;
}
interface LinkedSpansProps {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
references: any;
}
interface LinkedSpansState {
linkedSpans: SpanReference[];
count: number;
@@ -106,16 +101,3 @@ export function LinkedSpansPanel({
</div>
);
}
function LinkedSpans({ references }: LinkedSpansProps): JSX.Element {
const { linkedSpans, count, isOpen, toggleOpen } = useLinkedSpans(references);
return (
<div className={styles.root}>
<LinkedSpansToggle count={count} isOpen={isOpen} toggleOpen={toggleOpen} />
<LinkedSpansPanel linkedSpans={linkedSpans} isOpen={isOpen} />
</div>
);
}
export default LinkedSpans;

View File

@@ -64,10 +64,6 @@
gap: 8px;
}
.tableHeaderText {
color: var(--l1-foreground);
}
.tableRows {
margin-top: 8px;
display: flex;

View File

@@ -1,6 +1,5 @@
export const ROW_HEIGHT = 24;
export const SPAN_BAR_HEIGHT = 22;
export const SPAN_BAR_Y_OFFSET = Math.floor((ROW_HEIGHT - SPAN_BAR_HEIGHT) / 2);
export const EVENT_DOT_SIZE = 6;
// Span bar sizing relative to row height (used by getFlamegraphRowMetrics)

View File

@@ -33,15 +33,3 @@
.nestedRow {
padding-left: var(--spacing-6);
}
.rowLabel {
min-width: 0;
overflow-wrap: anywhere;
}
.rowValue {
min-width: 0;
overflow-wrap: anywhere;
text-align: right;
font-variant-numeric: tabular-nums;
}

View File

@@ -128,10 +128,6 @@
}
}
.spinner {
height: 400px;
}
.detailsView {
display: flex;
flex-direction: column;

View File

@@ -1,11 +0,0 @@
.root {
display: flex;
position: absolute;
transform: translate(-50%, -50%);
top: 50%;
right: 0;
cursor: pointer;
border-radius: 2px;
border: 1px solid var(--l1-border);
background: var(--l2-background);
}

View File

@@ -1,132 +0,0 @@
import { useCopySpanLink } from 'hooks/trace/useCopySpanLink';
import { fireEvent, render, screen, within } from 'tests/test-utils';
import { SpanV3 } from 'types/api/trace/getTraceV3';
import SpanLineActionButtons from '../index';
// Mock the useCopySpanLink hook
jest.mock('hooks/trace/useCopySpanLink');
const mockSpan: SpanV3 = {
span_id: 'test-span-id',
trace_id: 'test-trace-id',
parent_span_id: 'test-parent-span-id',
timestamp: 1234567890,
duration_nano: 1000,
name: 'test-span',
'service.name': 'test-service',
has_error: false,
status_message: 'test-status-message',
status_code: 0,
status_code_string: 'test-status-code-string',
kind: 0,
kind_string: 'test-span-kind',
has_children: false,
has_sibling: false,
sub_tree_node_count: 0,
level: 0,
attributes: {},
resource: {},
events: [],
http_method: '',
http_url: '',
http_host: '',
db_name: '',
db_operation: '',
external_http_method: '',
external_http_url: '',
response_status_code: '',
is_remote: '',
flags: 0,
trace_state: '',
};
describe('SpanLineActionButtons', () => {
beforeEach(() => {
// Clear mock before each test
jest.clearAllMocks();
});
it('renders copy link button with correct icon', () => {
(useCopySpanLink as jest.Mock).mockReturnValue({
onSpanCopy: jest.fn(),
});
render(<SpanLineActionButtons span={mockSpan} />);
// Check if the button is rendered
const copyButton = screen.getByRole('button');
expect(copyButton).toBeInTheDocument();
// Check that an icon is rendered inside the button
expect(
within(copyButton).getByTestId('copy-span-link-icon'),
).toBeInTheDocument();
});
it('calls onSpanCopy when copy button is clicked', () => {
const mockOnSpanCopy = jest.fn();
(useCopySpanLink as jest.Mock).mockReturnValue({
onSpanCopy: mockOnSpanCopy,
});
render(<SpanLineActionButtons span={mockSpan} />);
// Click the copy button
const copyButton = screen.getByRole('button');
fireEvent.click(copyButton);
// Verify the copy function was called
expect(mockOnSpanCopy).toHaveBeenCalledTimes(1);
});
it('copies span link to clipboard when copy button is clicked', () => {
const mockSetCopy = jest.fn();
const mockUrlQuery = {
delete: jest.fn(),
set: jest.fn(),
toString: jest.fn().mockReturnValue('spanId=test-span-id'),
};
const mockPathname = '/test-path';
// history@5 re-reads `window.location` on every access, so the stub has
// to carry the fields the router reads, not just the one under test.
const mockLocation = {
origin: 'http://localhost:3000',
href: 'http://localhost:3000/',
pathname: '/',
search: '',
hash: '',
};
// Mock window.location
Object.defineProperty(window, 'location', {
value: mockLocation,
writable: true,
});
// Mock useCopySpanLink hook
(useCopySpanLink as jest.Mock).mockReturnValue({
onSpanCopy: (event: React.MouseEvent) => {
event.preventDefault();
event.stopPropagation();
mockUrlQuery.delete('spanId');
mockUrlQuery.set('spanId', mockSpan.span_id);
const link = `${
window.location.origin
}${mockPathname}?${mockUrlQuery.toString()}`;
mockSetCopy(link);
},
});
render(<SpanLineActionButtons span={mockSpan} />);
// Click the copy button
const copyButton = screen.getByRole('button');
fireEvent.click(copyButton);
// Verify the copy function was called with correct link
expect(mockSetCopy).toHaveBeenCalledWith(
'http://localhost:3000/test-path?spanId=test-span-id',
);
});
});

View File

@@ -1,33 +0,0 @@
import { Button } from '@signozhq/ui/button';
import { Tooltip } from '@signozhq/ui/tooltip';
import { useCopySpanLink } from 'hooks/trace/useCopySpanLink';
import { Link } from '@signozhq/icons';
import { SpanV3 } from 'types/api/trace/getTraceV3';
import styles from './SpanLineActionButtons.module.scss';
export interface SpanLineActionButtonsProps {
span: SpanV3;
}
export default function SpanLineActionButtons({
span,
}: SpanLineActionButtonsProps): JSX.Element {
const { onSpanCopy } = useCopySpanLink(span);
return (
<div className={styles.root}>
<Tooltip title="Copy Span Link">
<Button
aria-label="Action"
variant="ghost"
size="sm"
icon
color="secondary"
onClick={onSpanCopy}
>
<Link size={14} data-testid="copy-span-link-icon" />
</Button>
</Tooltip>
</div>
);
}

View File

@@ -178,22 +178,6 @@
}
}
.sidebarResizeHandle {
width: 4px;
flex-shrink: 0;
cursor: col-resize;
user-select: none;
touch-action: none;
background: transparent;
transition: background 0.15s ease;
z-index: 1;
&:hover,
&:active {
background: rgba(35, 196, 248, 0.2);
}
}
.statusCol {
width: 50px;
flex-shrink: 0;

View File

@@ -37,9 +37,6 @@ jest.mock('components/TimelineV3/TimelineV3', () => ({
// Mock the hooks
jest.mock('hooks/useUrlQuery');
jest.mock('@signozhq/ui', () => ({
Badge: jest.fn(),
}));
const mockSpan: SpanV3 = {
span_id: 'test-span-id',

View File

@@ -66,14 +66,6 @@ jest.mock(
},
);
jest.mock('pages/TraceDetailsV3/TraceWaterfall/SpanLineActionButtons', () => {
function SpanLineActionButtons(): null {
return null;
}
SpanLineActionButtons.displayName = 'SpanLineActionButtons';
return SpanLineActionButtons;
});
jest.mock('components/HttpStatusBadge/HttpStatusBadge', () => {
function HttpStatusBadge(): null {
return null;

View File

@@ -53,12 +53,6 @@ import {
traceWaterfallResponse,
} from './__story_mockdata__/traceDetails';
/** Holds the download panel on screen: the export request never settles. */
export const hangingTraceExport = rest.post(
'http://localhost/api/v1/export_raw_data',
(_req, res, ctx) => res(ctx.delay('infinite')),
);
const TRACE = 'Trace · trace';
const PANEL = 'Trace · span panel';

View File

@@ -6,38 +6,12 @@
margin: 8px 16px;
gap: 8px;
}
.filter-outlined-btn {
border-radius: 0px 2px 2px 0px;
border-top: 1px solid var(--l1-border);
border-right: 1px solid var(--l1-border);
border-bottom: 1px solid var(--l1-border);
background: var(--l2-background);
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
}
}
.trace-explorer-header.single-child {
justify-content: flex-end;
}
.qb-search-view-container {
padding: 8px;
display: flex;
flex-direction: row;
align-items: center;
gap: 8px;
.ant-select-selector {
border-radius: 2px;
border: 1px solid var(--l1-border) !important;
background: var(--l2-background) !important;
height: 34px !important;
box-sizing: border-box !important;
}
}
.trace-explorer-page {
.trace-explorer {
background: var(--l1-background);

View File

@@ -4,7 +4,6 @@ import {
PANEL_TYPES,
} from 'constants/queryBuilder';
import { noop } from 'lodash-es';
import { DataTypes } from 'types/api/queryBuilder/queryAutocompleteResponse';
import { Query } from 'types/api/queryBuilder/queryBuilderData';
export const optionMenuReturn = {
@@ -115,45 +114,6 @@ export const optionMenuReturn = {
},
};
export const compositeQuery: Query = {
...initialQueriesMap.traces,
builder: {
...initialQueriesMap.traces.builder,
queryData: [
{
...initialQueryBuilderFormValues,
filters: {
items: [
{
id: '95564eb1',
key: {
key: 'name',
dataType: DataTypes.String,
type: 'tag',
id: 'name--string--tag--true',
},
op: 'in',
value: ['HTTP GET /customer'],
},
{
id: '3337951c',
key: {
key: 'serviceName',
dataType: DataTypes.String,
type: 'tag',
id: 'serviceName--string--tag--true',
},
op: 'in',
value: ['demo-app'],
},
],
op: 'AND',
},
},
],
},
};
export const redirectWithQueryBuilderData = jest.fn();
export const qbProviderValue = {

View File

@@ -60,9 +60,6 @@
}
}
&__description {
}
.funnel-item__action-icon {
opacity: 1;
}

View File

@@ -42,11 +42,5 @@
&--run {
background-color: var(--primary-background);
}
&--updating {
display: flex;
align-items: center;
gap: 4px;
color: var(--l2-foreground);
}
}
}

View File

@@ -18,10 +18,6 @@
flex-direction: column;
gap: 16px;
}
&__list {
margin-top: 16px;
}
&__loading {
display: flex;
flex-direction: column;
@@ -32,40 +28,4 @@
}
}
// Sort popover styles
.sort-funnels {
.ant-popover-content {
.ant-popover-inner {
padding: 0;
background: var(--l2-background);
border: 1px solid var(--l1-border);
border-radius: 4px;
.sort-content {
padding: 8px;
min-width: 160px;
.sort-heading {
color: var(--l2-foreground);
padding: 6px 8px;
}
.sort-btns {
width: 100%;
color: var(--l2-foreground);
display: flex;
justify-content: space-between;
align-items: center;
padding: 6px 8px;
&:hover {
background: var(--l1-border);
border-radius: 4px;
}
}
}
}
}
}
// Light mode styles

View File

@@ -64,11 +64,6 @@
flex-direction: column;
align-items: flex-start;
width: 140px;
&__heading {
letter-spacing: 0.88px;
text-transform: uppercase;
padding: 12px 18px 6px 14px;
}
&__button {
text-align: start;

View File

@@ -38,7 +38,6 @@ import {
spanLogRows,
spanLogScopeOf,
type SpanLogsState,
traceAttributeValuesResponse,
traceFieldKeysResponse,
traceFieldValues,
traceFunnelsResponse,
@@ -180,13 +179,6 @@ export const tracesMocks = defineStoryMocks({
),
),
rest.get(
'http://localhost/api/v3/autocomplete/attribute_values',
response.json((req) =>
traceAttributeValuesResponse(req.url.searchParams.get('attributeKey')),
),
),
rest.get(
'http://localhost/api/v2/saved_views',
response.json(() => savedTraceViewsResponse(values.savedViews)),