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

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:

主站蜘蛛池模板: 安顺市| 洪江市| 贞丰县| 黄梅县| 犍为县| 陆川县| 山丹县| 邯郸县| 婺源县| 竹溪县| 蓬莱市| 齐河县| 南乐县| 张家川| 通城县| 都江堰市| 上饶县| 夏河县| 大邑县| 左云县| 洞口县| 博乐市| 巢湖市| 新龙县| 扶绥县| 清水县| 铜山县| 漾濞| 井研县| 溆浦县| 天门市| 怀来县| 张家口市| 泾阳县| 屏山县| 弥渡县| 缙云县| 临颍县| 九江市| 宣威市| 稷山县|