在Spring Boot Actuator上显示Hibernate搜索统计数据

问题描述 投票:0回答:1

我有一个Spring Boot应用程序v.2.3.0,它的依赖关系如下。

  • Spring-boot-starter-data-jpa。
  • hibernate-search-orm 5.11.5版本。
  • spring-boot-starter-actuator

我的 application.properties 样子

# Enabling Actuator for all
management.endpoints.web.exposure.include=*

# Show Hibernate statistics. This works!
spring.jpa.properties.hibernate.generate_statistics=true

# Show Hibernate Search statistics. This works not!
spring.jpa.properties.hibernate.search.default.directory_provider = filesystem
spring.jpa.properties.hibernate.search.default.indexBase = /path/to/index
spring.jpa.properties.hibernate.search.generate_statistics=true

我可以在下面看到休眠的统计数据。/actuator/metrics但休眠搜索的统计信息没有出现。你知道,我怎样才能解决这个问题吗?

spring-boot hibernate-search spring-boot-actuator
1个回答
0
投票

我只是猜测,但是...... 在Spring中可能有一些组件将Hibernate ORM提供的统计数据转化为你的webapp上显示的东西。据我所知,Spring并没有提供任何Hibernate Search的集成,所以Hibernate Search缺少这个 "翻译 "组件,因此你看不到任何东西。

我建议你看看Hibernate ORM统计数据到底是如何出现在你的控制台上的;你可能需要为Hibernate Search实现类似的东西。

© www.soinside.com 2019 - 2024. All rights reserved.