Exception and Error Forensics
BitDive provides deep visibility into application failures by capturing not just logs, but the full runtime context of every error. Unlike traditional APM tools that sample data, BitDive records the precise state of your JVM when an anomaly occurs, providing deep observability into every failure.
What BitDive Captures
BitDive monitors errors across two main categories: internal method behavior and external dependency interactions.
1. Internal Method Exceptions
If a method throws a standard Java or Kotlin exception, BitDive captures it automatically.
Example Scenario:
public BankProgram getProgram(Bank bank, String programName) {
URI uri = buildUriWithPathVariables(programName);
// This call might throw RestClientException or SocketTimeoutException
return restTemplate.postForObject(uri, bank, BankProgram.class);
}
If restTemplate fails, BitDive provides:
- Automatic Classification: The call is flagged as an error in the service map and trace view.
- Full Stack Snapshots: The complete stack trace at the exact moment of failure.
- Parameter Capture: The values of
bankandprogramNamethat led to the fault.
2. Negative Return Values (Semantic Errors)
Standard exceptions aren't the only way a method fails. Often, code returns a "success" state that semantically represents an error.
BitDive can be configured to classify the following as anomalies:
- Null or Empty Returns:
null,Optional.empty(). - Error DTOs: Objects with fields like
success=falseorerrorCode != null. - Status Codes: Non-200 HTTP codes returned within a business logic wrapper.
3. External Dependency Errors
BitDive monitors the boundaries of your system, ensuring that when an external service fails, you know exactly why.
Captured sources include:
- HTTP/REST:
RestTemplate,Feign,WebClient,OkHttp. - Databases: JDBC/SQL query failures and timeouts.
- Message Brokers: Kafka, RabbitMQ, and JMS processing errors.
- Cloud Services: AWS/GCP/Azure SDK client exceptions.
Root-Cause Analysis via Dependency Tracing
When an error occurs in a complex call chain, BitDive identifies the root cause by correlating internal method failures with external dependency events.
Using the getProgram example above, if the underlying HTTP call returns a 500 Internal Server Error, BitDive:
- Flags the Method:
getProgram(...)is marked as failed because its execution ended with an exception. - Exposes the Dependency: The specific HTTP call inside
RestTemplateis highlighted in the trace. - Deep Forensics: You get hit with the raw details of the external call:
- URL & Method:
POST https://api.bank.com/v1/programs - Status & Headers:
500,Content-Type: application/problem+json - Payload Fragments: A snippet of the response body containing the remote error message.
- Latency: Exactly how many milliseconds the system was blocked before the timeout/error occurred.
- URL & Method:
Why This Matters for AI-Assisted Engineering
As AI agents write and refactor code at scale, "silent failures" (where code runs but returns wrong data) become a significant risk. BitDive's Exception Forensics acts as a safety net, ensuring that every deviation from expected runtime behavior is caught, contextualized, and presented with the runtime context needed for a surgical fix. This data powers both unit test creation and AI-assisted debugging.
Engineering Case Study Automatic Exception Logging: From Caught Exceptions to Regression Tests