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

Human operators

The primary use case for the JSON response payload is to provide a way for operators to investigate the application state. To support this, health checks allow for additional data to be attached to a health check response as we have seen in the CheckDiskspace and ServiceCheck examples. Consider the following fragment:

[...]
return HealthCheckResponse
.named("memory-check")
.withData("free-heap", "64mb")
.up()
.build();
[...]

Here, the additional information about free-heap is provided and will become part of the response payload, as shown in this response fragment. The JSON response fragment showing memory-check procedure content is as follows:

{
...
"checks": [
{
"name": "memory-check",
"state": "UP",
"data": {
"free-heap": "64mb"
}
}
],
"outcome": "UP"
}

Here, we see the memory-check procedure with its UP state and additional free-heap data item of the string type with the value of 64mb.

Eclipse resources/GitHub coordinates for MP-Health:
The MP-Health project source code can be found at  https://github.com/eclipse/microprofile-health.
主站蜘蛛池模板: 应城市| 东港市| 互助| 弋阳县| 屯门区| 扶沟县| 岳西县| 滁州市| 耒阳市| 武宁县| 台中市| 南靖县| 丰宁| 娱乐| 巴林左旗| 徐闻县| 曲水县| 河南省| 巫山县| 灌云县| 兴山县| 堆龙德庆县| 从化市| 赣榆县| 广丰县| 衡山县| 临武县| 财经| 凤阳县| 宝鸡市| 思茅市| 鄯善县| 玛多县| 定襄县| 商都县| 正镶白旗| 澜沧| 普安县| 百色市| 稻城县| 沾化县|