官术网_书友最值得收藏!

Pinging our app for general health

Each of these endpoints can be visited using our browser or using other tools like curl:

$ curl localhost:9000/application/health
{
"status": "UP",
"details": {
"mongo": {
"status": "UP",
"details": {
"version": "3.2.2"
}
},
"diskSpace": {
"status": "UP",
"details": {
"total": 498937626624,
"free": 66036432896,
"threshold": 10485760
}
}
}
}

This preceding health status gives us the following:

  • An overall UP status
  • The status of MongoDB
  • The status of the diskspace

When other components are added, they may, optionally, add their own health checks.

This immediately solves our first need listed previously. We can inform the system administrator that he or she can write a management script to interrogate our app's health.

Be warned that each of these endpoints serve up a compact JSON document. Generally speaking, command-line curl probably isn't the best option. While it's convenient on *nix and Mac systems, the content is dense and hard to read. It's more practical to have the following:

主站蜘蛛池模板: 宁阳县| 宁海县| 改则县| 宁都县| 古丈县| 防城港市| 宽甸| 三河市| 彰化市| 渭南市| 孟州市| 宿迁市| 大同市| 河西区| 宁陕县| 建始县| 通河县| 河北省| 湘乡市| 海林市| 广宗县| 来宾市| 临泉县| 花垣县| 客服| 临湘市| 麟游县| 文化| 原阳县| 日土县| 东乌珠穆沁旗| 开封县| 扶风县| 嘉峪关市| 张家川| 鄱阳县| 东安县| 陆丰市| 宁德市| 浦县| 景泰县|