Skip to content

Commit 814fb3d

Browse files
chore: removed sentry form server (#40990)
## Description > [!TIP] > _Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team)._ > > _Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR._ Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/15815846167> > Commit: 366aaa8 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=15815846167&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Mon, 23 Jun 2025 06:27:29 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Replaced Sentry-based error reporting with enhanced internal logging for exceptions. - Introduced a new logging utility to improve observability and error context in logs. - **Chores** - Removed Sentry integration and related error reporting code from the application. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent d3d4f0c commit 814fb3d

File tree

4 files changed

+40
-58
lines changed

4 files changed

+40
-58
lines changed

app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/InstanceConfig.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import com.appsmith.server.repositories.CacheableRepositoryHelper;
66
import com.appsmith.server.services.ConfigService;
77
import io.micrometer.observation.annotation.Observed;
8-
import io.sentry.Sentry;
98
import lombok.RequiredArgsConstructor;
109
import lombok.extern.slf4j.Slf4j;
1110
import org.springframework.boot.context.event.ApplicationReadyEvent;
@@ -71,7 +70,6 @@ public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
7170
startupProcess.block();
7271
} catch (Exception e) {
7372
log.debug("Application start up encountered an error: {}", e.getMessage());
74-
Sentry.captureException(e);
7573
}
7674
}
7775

app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/GlobalExceptionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import java.util.HashMap;
3636
import java.util.Map;
3737

38-
import static com.appsmith.server.exceptions.util.SentryLogger.doLog;
38+
import static com.appsmith.server.exceptions.util.ObservabilityLogger.doLog;
3939

4040
/**
4141
* This class catches all the Exceptions and formats them into a proper ResponseDTO<ErrorDTO> object before
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.appsmith.server.exceptions.util;
2+
3+
import com.appsmith.external.exceptions.AppsmithErrorAction;
4+
import com.appsmith.external.exceptions.BaseException;
5+
import lombok.extern.slf4j.Slf4j;
6+
7+
import java.io.PrintWriter;
8+
import java.io.StringWriter;
9+
10+
@Slf4j
11+
public class ObservabilityLogger {
12+
public static void doLog(Throwable error) {
13+
if (error instanceof BaseException baseException && baseException.isHideStackTraceInLogs()) {
14+
log.error(baseException.getClass().getSimpleName() + ": " + baseException.getMessage());
15+
} else {
16+
log.error("", error);
17+
}
18+
19+
StringWriter stringWriter = new StringWriter();
20+
PrintWriter printWriter = new PrintWriter(stringWriter);
21+
error.printStackTrace(printWriter);
22+
String stringStackTrace = stringWriter.toString();
23+
24+
// Log stack trace for debugging
25+
log.error("Stack Trace: {}", stringStackTrace);
26+
27+
if (error instanceof BaseException) {
28+
BaseException baseError = (BaseException) error;
29+
if (baseError.getErrorAction() == AppsmithErrorAction.LOG_EXTERNALLY) {
30+
// Log additional context for external logging
31+
log.error(
32+
"Downstream Error - Message: {}, Code: {}",
33+
baseError.getDownstreamErrorMessage(),
34+
baseError.getDownstreamErrorCode());
35+
baseError.getContextMap().forEach((key, value) -> log.error("Context - {}: {}", key, value));
36+
}
37+
}
38+
}
39+
}

app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/util/SentryLogger.java

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)