forked from digma-ai/otel-sample-app-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Issue Description
The MonitorService is experiencing critical IllegalStateException failures that are unhandled and occurring frequently. This is causing service instability and needs to be addressed.
Root Cause
- The monitor() method deliberately throws IllegalStateException without proper handling
- No circuit breaker or fallback mechanisms are in place
- Error injection is hardcoded rather than configurable
- Insufficient instrumentation for monitoring and debugging
Solution
A PR has been created (#55) that implements the following fixes:
- Makes error injection configurable for testing purposes
- Implements circuit breaker pattern to prevent cascading failures
- Adds proper error handling with recovery mechanisms
- Enhances OpenTelemetry instrumentation
Implementation Details
The changes include:
- Configuration for controlling error injection
- Circuit breaker implementation with failure counting
- Recovery logic with exponential backoff
- Enhanced OpenTelemetry attributes and events
Testing
The solution can be tested by:
- Running with error injection enabled/disabled
- Verifying circuit breaker activation
- Checking recovery behavior
- Monitoring OpenTelemetry metrics