How jeyprabu/systemlogs-anomaly-detection works
This platform accepts system metrics through a Spring REST API, delegates inference to a Python Isolation Forest service, persists the combined metrics and prediction, and returns the prediction to the caller. The ML service scales inputs, scores anomalies, assigns severity, and identifies contributing metrics. The README also describes Docker Compose deployment; deployment machinery is omitted here. Relationships are based on the sampled controller, client, model service, and README; unsampled configuration and persistence wiring are not inferred.
Main entry points: ml_service.py Inference Endpoint · LogController.java Log Controller · MlClientService.java ML Client · SystemLogRepository.java Log Repository
Components 14
Spring API
- Log Controller
spring-anomaly-api/src/main/java/com/anomaly/endpoint/controller/LogController.java - Metrics Request
spring-anomaly-api/src/main/java/com/anomaly/endpoint/dto/LogRequest.java - ML Client
spring-anomaly-api/src/main/java/com/anomaly/endpoint/service/MlClientService.java - Prediction DTO
spring-anomaly-api/src/main/java/com/anomaly/endpoint/dto/MlPredictionResponse.java
ML Inference
- Inference Endpoint
ml-anomaly-service/ml_service.py - ML Input Schema
ml-anomaly-service/ml_service.py - Feature Scaling
ml-anomaly-service/ml_service.py - Isolation Forest
ml-anomaly-service/ml_service.py - Severity Scoring
ml-anomaly-service/ml_service.py - Cause Ranking
ml-anomaly-service/ml_service.py
Prediction Storage
- Stored Log
spring-anomaly-api/src/main/java/com/anomaly/endpoint/model/SystemLog.java - Log Repository
spring-anomaly-api/src/main/java/com/anomaly/endpoint/repository/SystemLogRepository.java - MongoDB Atlas
Other components
- API Client
Connections 14
- API Client → Log Controller: submits metrics
README.md - Log Controller → Metrics Request: accepts body
spring-anomaly-api/src/main/java/com/anomaly/endpoint/controller/LogController.java - Log Controller → ML Client: requests prediction
spring-anomaly-api/src/main/java/com/anomaly/endpoint/controller/LogController.java - ML Client → Inference Endpoint: POST /predict
spring-anomaly-api/src/main/java/com/anomaly/endpoint/service/MlClientService.java - Inference Endpoint → ML Input Schema: parses input
ml-anomaly-service/ml_service.py - Inference Endpoint → Feature Scaling: scales features
ml-anomaly-service/ml_service.py - Inference Endpoint → Isolation Forest: predicts and scores
ml-anomaly-service/ml_service.py - Inference Endpoint → Severity Scoring: assigns severity
ml-anomaly-service/ml_service.py - Inference Endpoint → Cause Ranking: ranks metrics
ml-anomaly-service/ml_service.py - Inference Endpoint → Prediction DTO: returns prediction
README.md - Log Controller → Stored Log: builds record
spring-anomaly-api/src/main/java/com/anomaly/endpoint/controller/LogController.java - Log Controller → Log Repository: saves record
spring-anomaly-api/src/main/java/com/anomaly/endpoint/controller/LogController.java - Log Repository → MongoDB Atlas: persists logs
README.md - Log Controller → API Client: returns prediction
spring-anomaly-api/src/main/java/com/anomaly/endpoint/controller/LogController.java