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
fix: apply filters on count of exceptions (#1945)
Vishal Sharma6ba5c0ecad12
diff --git a/frontend/src/container/AllError/index.tsx b/frontend/src/container/AllError/index.tsxindex 5d4a6367b3..e7f2e64bcc 100644--- a/frontend/src/container/AllError/index.tsx+++ b/frontend/src/container/AllError/index.tsx@@ -108,12 +108,21 @@ function AllErrors(): JSX.Element {enabled: !loading,},{- queryKey: ['getErrorCounts', maxTime, minTime],+ queryKey: [+ 'getErrorCounts',+ maxTime,+ minTime,+ getUpdatedExceptionType,+ getUpdatedServiceName,+ ],queryFn: (): Promise<ErrorResponse | SuccessResponse<number>> =>getErrorCounts({end: maxTime,start: minTime,+ exceptionType: getUpdatedExceptionType,+ serviceName: getUpdatedServiceName,}),+ enabled: !loading,},]);diff --git a/frontend/src/types/api/errors/getErrorCounts.ts b/frontend/src/types/api/errors/getErrorCounts.tsindex ab690bd0c6..67526d3093 100644--- a/frontend/src/types/api/errors/getErrorCounts.ts+++ b/frontend/src/types/api/errors/getErrorCounts.ts@@ -3,6 +3,8 @@ import { GlobalTime } from 'types/actions/globalTime';export type Props = {start: GlobalTime['minTime'];end: GlobalTime['minTime'];+ exceptionType: string;+ serviceName: string;};export type PayloadProps = number;diff --git a/pkg/query-service/app/clickhouseReader/reader.go b/pkg/query-service/app/clickhouseReader/reader.goindex 81a91c7e0a..15c88e2b71 100644--- a/pkg/query-service/app/clickhouseReader/reader.go+++ b/pkg/query-service/app/clickhouseReader/reader.go@@ -2592,12 +2592,12 @@ func (r *ClickHouseReader) CountErrors(ctx context.Context, queryParams *model.Cquery := fmt.Sprintf("SELECT count(distinct(groupID)) FROM %s.%s WHERE timestamp >= @timestampL AND timestamp <= @timestampU", r.TraceDB, r.errorTable)args := []interface{}{clickhouse.Named("timestampL", strconv.FormatInt(queryParams.Start.UnixNano(), 10)), clickhouse.Named("timestampU", strconv.FormatInt(queryParams.End.UnixNano(), 10))}if len(queryParams.ServiceName) != 0 {- query = query + " AND serviceName = @serviceName"- args = append(args, clickhouse.Named("serviceName", queryParams.ServiceName))+ query = query + " AND serviceName ilike @serviceName"+ args = append(args, clickhouse.Named("serviceName", "%"+queryParams.ServiceName+"%"))}if len(queryParams.ExceptionType) != 0 {- query = query + " AND exceptionType = @exceptionType"- args = append(args, clickhouse.Named("exceptionType", queryParams.ExceptionType))+ query = query + " AND exceptionType ilike @exceptionType"+ args = append(args, clickhouse.Named("exceptionType", "%"+queryParams.ExceptionType+"%"))}err := r.db.QueryRow(ctx, query, args...).Scan(&errorCount)zap.S().Info(query)diff --git a/pkg/query-service/app/parser.go b/pkg/query-service/app/parser.goindex d14c0afc82..67903594c7 100644--- a/pkg/query-service/app/parser.go+++ b/pkg/query-service/app/parser.go@@ -507,10 +507,14 @@ func parseCountErrorsRequest(r *http.Request) (*model.CountErrorsParams, error)if err != nil {return nil, err}+ serviceName := r.URL.Query().Get("serviceName")+ exceptionType := r.URL.Query().Get("exceptionType")params := &model.CountErrorsParams{- Start: startTime,- End: endTime,+ Start: startTime,+ End: endTime,+ ServiceName: serviceName,+ ExceptionType: exceptionType,}return params, nil