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 top errors to traces corelation

sawhil42a026469bd1
diff --git a/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/DomainDetails.styles.scss b/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/DomainDetails.styles.scss
index dc7775414b..2a12e807fb 100644
--- a/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/DomainDetails.styles.scss
+++ b/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/DomainDetails.styles.scss
@@ -308,6 +308,7 @@
.ant-table-tbody > tr:hover > td {
background: rgba(255, 255, 255, 0.04);
+ cursor: pointer;
}
.ant-table-cell:first-child {
diff --git a/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/DomainDetails.tsx b/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/DomainDetails.tsx
index d762ae8fa4..2909525bbd 100644
--- a/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/DomainDetails.tsx
+++ b/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/DomainDetails.tsx
@@ -228,7 +228,6 @@ function DomainDetails({
{selectedView === VIEW_TYPES.TOP_ERRORS && (
<TopErrors
domainName={domainData.domainName}
- initialFilters={domainListFilters}
timeRange={modalTimeRange}
handleTimeChange={handleTimeChange}
/>
diff --git a/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/TopErrors.tsx b/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/TopErrors.tsx
index bdf6e840a0..d8d7c9e837 100644
--- a/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/TopErrors.tsx
+++ b/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/TopErrors.tsx
@@ -1,5 +1,6 @@
import { LoadingOutlined } from '@ant-design/icons';
import { Spin, Table, Tooltip, Typography } from 'antd';
+import { useNavigateToExplorer } from 'components/CeleryTask/useNavigateToExplorer';
import { DEFAULT_ENTITY_VERSION, ENTITY_VERSION_V4 } from 'constants/app';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import {
@@ -7,6 +8,7 @@ import {
formatTopErrorsDataForTable,
getEndPointDetailsQueryPayload,
getTopErrorsColumnsConfig,
+ getTopErrorsCoRelationQueryFilters,
getTopErrorsQueryPayload,
TopErrorsResponseRow,
} from 'container/ApiMonitoring/utils';
@@ -21,7 +23,7 @@ import { useQueries } from 'react-query';
import { SuccessResponse } from 'types/api';
import { MetricRangePayloadProps } from 'types/api/metrics/getQueryRange';
import { DataTypes } from 'types/api/queryBuilder/queryAutocompleteResponse';
-import { IBuilderQuery } from 'types/api/queryBuilder/queryBuilderData';
+import { DataSource } from 'types/common/queryBuilder';
import EndPointsDropDown from './components/EndPointsDropDown';
import ErrorState from './components/ErrorState';
@@ -30,7 +32,6 @@ import { SPAN_ATTRIBUTES } from './constants';
function TopErrors({
domainName,
timeRange,
- initialFilters,
handleTimeChange,
}: {
domainName: string;
@@ -38,7 +39,6 @@ function TopErrors({
startTime: number;
endTime: number;
};
- initialFilters: IBuilderQuery['filters'];
handleTimeChange: (
interval: Time | CustomTimeType,
dateTimeRange?: [number, number],
@@ -65,12 +65,11 @@ function TopErrors({
op: '=',
value: endPointName,
},
- ...initialFilters.items,
]
: [],
op: 'AND',
}),
- [domainName, endPointName, minTime, maxTime, initialFilters],
+ [domainName, endPointName, minTime, maxTime],
);
// Since only one query here
@@ -140,6 +139,8 @@ function TopErrors({
handleTimeChange('6h');
}, [handleTimeChange]);
+ const navigateToExplorer = useNavigateToExplorer();
+
if (isError) {
return (
<div className="all-endpoints-error-state-wrapper">
@@ -201,6 +202,22 @@ function TopErrors({
rowClassName={(_, index): string =>
index % 2 === 0 ? 'table-row-dark' : 'table-row-light'
}
+ onRow={(record): { onClick: () => void } => ({
+ onClick: (): void => {
+ const filters = getTopErrorsCoRelationQueryFilters(
+ domainName,
+ record.endpointName,
+ record.statusCode,
+ );
+ navigateToExplorer({
+ filters: [...filters.items],
+ dataSource: DataSource.TRACES,
+ startTime: minTime,
+ endTime: maxTime,
+ shouldResolveQuery: true,
+ });
+ },
+ })}
/>
</div>
</div>
diff --git a/frontend/src/container/ApiMonitoring/utils.tsx b/frontend/src/container/ApiMonitoring/utils.tsx
index fe74688971..7d82dfa314 100644
--- a/frontend/src/container/ApiMonitoring/utils.tsx
+++ b/frontend/src/container/ApiMonitoring/utils.tsx
@@ -1375,6 +1375,66 @@ export const formatTopErrorsDataForTable = (
}));
};
+export const getTopErrorsCoRelationQueryFilters = (
+ domainName: string,
+ endPointName: string,
+ statusCode: string,
+): IBuilderQuery['filters'] => ({
+ items: [
+ {
+ id: 'ea16470b',
+ key: {
+ key: 'http.url',
+ dataType: DataTypes.String,
+ type: 'tag',
+ isColumn: false,
+ isJSON: false,
+ id: 'http.url--string--tag--false',
+ },
+ op: '=',
+ value: endPointName,
+ },
+ {
+ id: 'b0ef3799',
+ key: {
+ key: 'has_error',
+ dataType: DataTypes.bool,
+ type: '',
+ isColumn: false,
+ isJSON: false,
+ },
+ op: '=',
+ value: 'true',
+ },
+ {
+ id: 'e8a043b7',
+ key: {
+ key: 'net.peer.name',
+ dataType: DataTypes.String,
+ type: '',
+ isColumn: false,
+ isJSON: false,
+ },
+ op: '=',
+ value: domainName,
+ },
+ {
+ id: 'f6891e27',
+ key: {
+ key: 'status_code',
+ dataType: DataTypes.Float64,
+ type: '',
+ isColumn: true,
+ isJSON: false,
+ id: 'status_code--float64----true',
+ },
+ op: '=',
+ value: statusCode,
+ },
+ ],
+ op: 'AND',
+});
+
export const getTopErrorsColumnsConfig = (): ColumnType<TopErrorsTableRowData>[] => [
{
title: <div className="endpoint-name-header">Endpoint</div>,
@@ -1386,7 +1446,11 @@ export const getTopErrorsColumnsConfig = (): ColumnType<TopErrorsTableRowData>[]
className: 'column',
render: (text: string, record: TopErrorsTableRowData): React.ReactNode => {
const { endpoint } = extractPortAndEndpoint(record.endpointName);
- return <div className="endpoint-name-value">{endpoint}</div>;
+ return (
+ <Tooltip title="Click to open traces">
+ <div className="endpoint-name-value">{endpoint}</div>
+ </Tooltip>
+ );
},
},
{
@@ -3602,7 +3666,6 @@ export const getGroupByFiltersFromGroupByValues = (
};
});
- console.log('uncaught items', items);
return {
items,
op: 'AND',