diff --git a/app/client/src/ce/sagas/userSagas.tsx b/app/client/src/ce/sagas/userSagas.tsx index cbf80d702d57..4e881be6fc5e 100644 --- a/app/client/src/ce/sagas/userSagas.tsx +++ b/app/client/src/ce/sagas/userSagas.tsx @@ -88,7 +88,8 @@ import type { } from "reducers/uiReducers/usersReducer"; import { selectFeatureFlags } from "ee/selectors/featureFlagsSelectors"; import { getFromServerWhenNoPrefetchedResult } from "sagas/helper"; - +import * as Sentry from "@sentry/react"; +import { Severity } from "@sentry/react"; export function* createUserSaga( action: ReduxActionWithPromise, ) { @@ -129,6 +130,12 @@ export function* createUserSaga( error, }, }); + Sentry.captureException("Sign up failed", { + level: Severity.Error, + extra: { + error: error, + }, + }); } } diff --git a/app/client/src/pages/UserAuth/Login.tsx b/app/client/src/pages/UserAuth/Login.tsx index 2dde2eff9ce4..76f59aa5a50e 100644 --- a/app/client/src/pages/UserAuth/Login.tsx +++ b/app/client/src/pages/UserAuth/Login.tsx @@ -51,7 +51,8 @@ import Helmet from "react-helmet"; import { useFeatureFlag } from "utils/hooks/useFeatureFlag"; import { FEATURE_FLAG } from "ee/entities/FeatureFlag"; import { getHTMLPageTitle } from "ee/utils/BusinessFeatures/brandingPageHelpers"; - +import * as Sentry from "@sentry/react"; +import { Severity } from "@sentry/react"; const validate = (values: LoginFormValues, props: ValidateProps) => { const errors: LoginFormValues = {}; const email = values[LOGIN_FORM_EMAIL_FIELD_NAME] || ""; @@ -113,6 +114,12 @@ export function Login(props: LoginFormProps) { if (queryParams.get("error")) { errorMessage = queryParams.get("message") || queryParams.get("error") || ""; showError = true; + Sentry.captureException("Login failed", { + level: Severity.Error, + extra: { + error: new Error(errorMessage), + }, + }); } let loginURL = "/api/v1/" + LOGIN_SUBMIT_PATH; diff --git a/app/client/src/pages/UserAuth/SignUp.tsx b/app/client/src/pages/UserAuth/SignUp.tsx index fccce68f5e1f..0d5db6e3eec5 100644 --- a/app/client/src/pages/UserAuth/SignUp.tsx +++ b/app/client/src/pages/UserAuth/SignUp.tsx @@ -57,6 +57,8 @@ import { FEATURE_FLAG } from "ee/entities/FeatureFlag"; import { getHTMLPageTitle } from "ee/utils/BusinessFeatures/brandingPageHelpers"; import log from "loglevel"; import { SELF_HOSTING_DOC } from "constants/ThirdPartyConstants"; +import * as Sentry from "@sentry/react"; +import { Severity } from "@sentry/react"; declare global { interface Window { @@ -133,6 +135,12 @@ export function SignUp(props: SignUpFormProps) { if (queryParams.get("error")) { errorMessage = queryParams.get("error") || ""; showError = true; + Sentry.captureException("Sign up failed", { + level: Severity.Error, + extra: { + error: new Error(errorMessage), + }, + }); } const signupURL = new URL( diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/BaseSpan.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/BaseSpan.java index b654c4847947..d6612827ce58 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/BaseSpan.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/BaseSpan.java @@ -9,4 +9,8 @@ public class BaseSpan { public static final String GIT_SPAN_PREFIX = "git."; public static final String APPLICATION_SPAN_PREFIX = "application."; + + public static final String AUTHENTICATE = "authenticate"; + + public static final String AUTHORIZE = "authorize"; } diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/TracingConfig.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/TracingConfig.java index a6cb5092d50d..fc22c4af4790 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/TracingConfig.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/TracingConfig.java @@ -10,6 +10,8 @@ import org.springframework.http.server.reactive.observation.ServerRequestObservationContext; import static com.appsmith.external.constants.spans.BaseSpan.APPSMITH_SPAN_PREFIX; +import static com.appsmith.external.constants.spans.BaseSpan.AUTHENTICATE; +import static com.appsmith.external.constants.spans.BaseSpan.AUTHORIZE; /** * This configuration file creates beans that are required to filter just Appsmith specific spans @@ -45,8 +47,10 @@ ObservationPredicate noActuatorServerObservations() { SpanExportingPredicate onlyAppsmithSpans() { return (finishedSpan) -> { if ((finishedSpan.getKind() != null && finishedSpan.getKind().equals(Span.Kind.SERVER)) - || finishedSpan.getName().startsWith(APPSMITH_SPAN_PREFIX)) { - // A span is either an http server request root or Appsmith specific + || finishedSpan.getName().startsWith(APPSMITH_SPAN_PREFIX) + || finishedSpan.getName().startsWith(AUTHENTICATE) + || finishedSpan.getName().startsWith(AUTHORIZE)) { + // A span is either an http server request root or Appsmith specific or login related or signup related return true; } else { return false;