Application down time metric

We like to create new panel to track application exact down time and total down time in grafana. I found metrics name only for application up details. do we have some libraries to server or application (java service)?

Please suggest how will do it