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.

fix(explorer): stop reporting dropped order by to sentry (#13153)

Aditya Singhe4e58e234988
diff --git a/frontend/src/utils/__tests__/sanitizeOrderBy.test.ts b/frontend/src/utils/__tests__/sanitizeOrderBy.test.ts
index 1ab6c4fd13..2c207dfe43 100644
--- a/frontend/src/utils/__tests__/sanitizeOrderBy.test.ts
+++ b/frontend/src/utils/__tests__/sanitizeOrderBy.test.ts
@@ -1,3 +1,4 @@
+import * as Sentry from '@sentry/react';
import { DataTypes } from 'types/api/queryBuilder/queryAutocompleteResponse';
import {
IBuilderQuery,
@@ -7,6 +8,10 @@ import { DataSource } from 'types/common/queryBuilder';
import { getParsedAggregationOptionsForOrderBy } from 'utils/aggregationConverter';
import { sanitizeOrderByForExplorer } from 'utils/sanitizeOrderBy';
+jest.mock('@sentry/react', () => ({
+ captureEvent: jest.fn(),
+}));
+
jest.mock('utils/aggregationConverter', () => ({
getParsedAggregationOptionsForOrderBy: jest.fn(),
}));
@@ -117,6 +122,7 @@ describe('sanitizeOrderByForExplorer', () => {
const result = sanitizeOrderByForExplorer(query);
expect(result).toStrictEqual([]);
+ expect(Sentry.captureEvent).not.toHaveBeenCalled();
});
it('handles missing orderBy by returning an empty array', () => {
diff --git a/frontend/src/utils/sanitizeOrderBy.ts b/frontend/src/utils/sanitizeOrderBy.ts
index b0ed1c3652..0d72e7c823 100644
--- a/frontend/src/utils/sanitizeOrderBy.ts
+++ b/frontend/src/utils/sanitizeOrderBy.ts
@@ -1,4 +1,3 @@
-import * as Sentry from '@sentry/react';
import {
IBuilderQuery,
OrderByPayload,
@@ -20,15 +19,5 @@ export function sanitizeOrderByForExplorer(
const current = query.orderBy || [];
- const hasInvalidOrderBy = current.some((o) => !allowed.has(o.columnName));
-
- if (hasInvalidOrderBy) {
- Sentry.captureEvent({
- message: `Invalid orderBy: current: ${JSON.stringify(
- current,
- )} - allowed: ${JSON.stringify(Array.from(allowed))}`,
- level: 'warning',
- });
- }
return current.filter((o) => allowed.has(o.columnName));
}