Generate a fingerprint:
import io.github.bugdna.BugDna;
import io.github.bugdna.Fingerprint;
try {
runApplicationCode();
} catch (Exception exception) {
Fingerprint fingerprint = BugDna.generate(exception);
System.out.println(fingerprint.getId());
}
Track recurring failures:
FailureTracker tracker = new FailureTracker();
tracker.capture(exception);
System.out.println(tracker.topFailureReport());
Enable Spring Boot capture:
@EnableBugDna
@SpringBootApplication
class Application {
}
Design Notes
BugDNA is a diagnostic infrastructure, not an error-response framework.
The core library has no Spring, SLF4J, Micrometer, or persistence dependency. The Spring Boot starter connects the core functionality to web exception capture, logging, Actuator, and metrics.
BugDNA stores tracker and recent-fingerprint data in memory. Restarting the process resets this state. For long-term history, export BugDNA IDs to your existing log, metric, tracing, or storage system.
The fingerprint algorithm does not hash exception messages, but fingerprint objects and recent snapshots can include application class and method names. Protect diagnostic endpoints and logs according to your application's privacy and security requirements.
Best Use Cases
BugDNA is useful when you want to:
Group recurring Java exceptions under stable IDs
Add compact failure identifiers to logs
Track top failure signatures in batch jobs or services
Detect sudden bursts of repeated failures
Compare new, resolved, and recurring failures between deployments
Add failure IDs to Spring Boot logs, MDC, Actuator, and metrics
Analyse existing logs that already contain BugDNA IDs
Observability
BugDNA can connect failure fingerprints to existing observability tools.
Spring Boot starter integrations:
Automatic MVC exception logging
Automatic WebFlux exception logging
SLF4J MDC fields
Actuator recent-fingerprint endpoint
Micrometer metrics
Prometheus-compatible metric names