Automate root cause analysis and predict defects in real time