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
feat: update logEvent to silently handle errors (#5599)
Yunus M18b608a1d8b2
diff --git a/frontend/src/api/common/logEvent.ts b/frontend/src/api/common/logEvent.tsindex 212d382d77..a1bf3dba7c 100644--- a/frontend/src/api/common/logEvent.ts+++ b/frontend/src/api/common/logEvent.ts@@ -1,4 +1,4 @@-import axios from 'api';+import { ApiBaseInstance as axios } from 'api';import { ErrorResponseHandler } from 'api/ErrorResponseHandler';import { AxiosError } from 'axios';import { ErrorResponse, SuccessResponse } from 'types/api';@@ -21,6 +21,7 @@ const logEvent = async (payload: response.data.data,};} catch (error) {+ console.error(error);return ErrorResponseHandler(error as AxiosError);}};diff --git a/frontend/src/api/index.ts b/frontend/src/api/index.tsindex 1ec4cda601..7f5e2d476c 100644--- a/frontend/src/api/index.ts+++ b/frontend/src/api/index.ts@@ -96,6 +96,10 @@ const interceptorRejected = async (}};+const interceptorRejectedBase = async (+ value: AxiosResponse<any>,+): Promise<AxiosResponse<any>> => Promise.reject(value);+const instance = axios.create({baseURL: `${ENVIRONMENT.baseURL}${apiV1}`,});@@ -140,6 +144,18 @@ ApiV4Instance.interceptors.response.use(ApiV4Instance.interceptors.request.use(interceptorsRequestResponse);//+// axios Base+export const ApiBaseInstance = axios.create({+ baseURL: `${ENVIRONMENT.baseURL}${apiV1}`,+});++ApiBaseInstance.interceptors.response.use(+ interceptorsResponse,+ interceptorRejectedBase,+);+ApiBaseInstance.interceptors.request.use(interceptorsRequestResponse);+//+// gateway Api V1export const GatewayApiV1Instance = axios.create({baseURL: `${ENVIRONMENT.baseURL}${gatewayApiV1}`,diff --git a/frontend/src/hooks/analytics/useAnalytics.tsx b/frontend/src/hooks/analytics/useAnalytics.tsxindex 28213c9579..e3d2081766 100644--- a/frontend/src/hooks/analytics/useAnalytics.tsx+++ b/frontend/src/hooks/analytics/useAnalytics.tsx@@ -32,16 +32,6 @@ const useAnalytics = (): any => {}};- // useEffect(() => {- // // Perform any setup or cleanup related to the analytics library- // // For example, initialize analytics library here-- // // Clean-up function (optional)- // return () => {- // // Perform cleanup if needed- // };- // }, []); // The empty dependency array ensures that this effect runs only once when the component mounts-return { trackPageView, trackEvent };};