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

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:

主站蜘蛛池模板: 张北县| 赣州市| 镇原县| 宜城市| 永新县| 铁岭市| 临泽县| 乡城县| 信阳市| 资源县| 宜黄县| 北川| 禹州市| 汉中市| 包头市| 溆浦县| 永宁县| 织金县| 油尖旺区| 普兰店市| 英德市| 正宁县| 陇西县| 阿克苏市| 昭觉县| 慈利县| 隆子县| 深圳市| 南华县| 武清区| 塔河县| 珲春市| 武穴市| 将乐县| 林州市| 龙门县| 镇江市| 遂昌县| 桐乡市| 开封市| 潞城市|