spring-boot - 为什么没有返回春季健康指标的详细信息?
问题描述
我目前正在使用 spring boot 2.1.4 和 jackson 2.9.8 当点击健康端点时,不显示详细信息。
{
status: "UP"
}
我已将以下属性添加到我的配置中。
management.endpoint.health.show-details=always
当我查看环境management.endpoint.health.show-details
时,它已设置。
当我监视org.springframework.boot.actuate.health.HealthWebEndpointResponseMapper.HealthWebEndpointResponseMapper(HealthStatusHttpMapper, ShowDetails, Set<String>)
时,它显示ALWAYS
实际上正在使用,并且没有删除细节。
但是,当它到达com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector
它时不会添加细节,因为该方法getDetails
没有org.springframework.boot.actuate.health.Health
像getStatus
(being @JsonWrapped
)那样被注释
如何让 Jackson 序列化详细信息,以便可以通过健康端点返回它们?
编辑:这似乎是由在启动时注入 spring 环境的自定义 ObjectMapper 引起的,该环境将 AUTO_DETECT_GETTERS 和 AUTO_DETECT_IS_GETTERS 都设置为禁用。虽然这可能在 Spring 4 中起作用,但它似乎在 Spring 5 中不再起作用。
解决方案
推荐阅读
- javascript - 如何将 onClick 功能添加到操作表?
- python - Nginx - 从上游读取响应标头时上游过早关闭连接
- python-3.x - 有没有办法为 ipywidgets 中的容器设置标题值?
- google-chrome - Chrome 上的 getUserMedia 经常无法返回最佳分辨率
- ubuntu - Nginx 只响应 localhost: 但不响应 server_name
- sql - 我希望我的 PK 的身份种子从 1 开始
- android - 用于 React Native .60 + 的 React Native 链接
- django - ReactJs:传递道具并在 map() 中使用它
- javascript - node js是否并行执行多个命令?
- visual-studio-code - why there is no selection when I click F5 to run program in vscode