Handled / catched exceptions are getting into Azure Application Insights
@heyams is already working on this.
Since Aug 15, 2024.
Assessment
This issue has not been assessed yet.
Description
Expected behavior
We have a handled exception in our application. When that exception is thrown and catched we should not see the occurrence of that exception in Application Insights.
Actual behavior
The thrown and catched exception is displayed in our Application Insights.
To Reproduce
- Create a new Spring Boot application with a scheduled task and use ShedLock to synchronize that task over multiple containers running in parallel with mongoDB setup (cosmos db)
// Run every 15 minutes (xx:00, xx:15, xx:30, xx:45)
@Scheduled(cron = "0 */15 * * * *")
@SchedulerLock(name = "uniqueString", lockAtMostFor = "14m", lockAtLeastFor = "14m")
public void myScheduledTask() {
service.runTask();
}
- Setup the MongoLockProvider for ShedLock
@Bean
public LockProvider lockProvider(final MongoClient mongo) {
return new MongoLockProvider(mongo.getDatabase(mongoDatabaseName));
}
- Setup Application Insights for the Spring Boot application
- Run the application with 2 containers in parallel (in our case in a container app)
- Observe the Application Insights Exceptions: Every time the task is scheduled ShedLock will try to lock the task in both containers. That means every time one of the containers will receive an duplicate key exception that is catched within the MongoLockProvider. These exceptions are shown in Application Insights.
System information
Please provide the following information:
- SDK Version: Java SDK 21-temurin
- OS type and version: eclipse-temurin:21-jre-alpine docker image
- Application Server type and version (if applicable): Azure Container App
- Using spring-boot? Yes with Spring-Boot-Starter-Parent v3.3.2
- Additional relevant libraries (with version, if applicable): ShedLock v5.14.0 => net.javacrumbs.shedlock -> shedlock-spring & shedlock-provider-mongo
- Dominant language
- Java
- Stars
- 327
- Forks
- 222
- Avg merge
- 22h 34m
- Merged PRs (30d)
- 14
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/ApplicationInsights-Java
-
microsoft/ApplicationInsights-Java#4851 · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
microsoft/ApplicationInsights-Java#4817 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
microsoft/ApplicationInsights-Java#4770 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
microsoft/ApplicationInsights-Java#4769 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/ApplicationInsights-Java#4729 · 120 comments ·
All issues in microsoft/ApplicationInsights-Java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
checkstyle/test-configs#263 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·