我已经配置了一个数据源,它可以在我的代码中工作,但是我无法让它报告Actuator /metrics端点上的指标。
我的设置如下:
它确实出现在/heath上。我注意到了/configprops端点上的以下内容,我猜想它就是issue...although,我不知道该如何处理它:
"spring.datasource.CONFIGURATION_PROPERTIES": {
"prefix": "spring.datasource",
"properties": {
"error": "Cannot serialize 'spring.datasource'"
}
},就像我说的,在/health上“快乐”:
{
"status": "UP",
"customHealthCheck": {
"status": "UP"
},
"jms": {
"status": "UP",
"provider": "HornetQ"
},
"diskSpace": {
"status": "UP",
"total": 499055067136,
"free": 285583982592,
"threshold": 10485760
},
"db": {
"status": "UP",
"database": "Oracle",
"hello": "Hello"
}
}这是我的application.properties,如果有什么帮助的话。
server.servlet-path=/*
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
spring.datasource.jndi-name=java:jboss/yourfriendthedatabase-ds
spring.datasource.validation-query=SELECT 1 FROM DUAL
# escapes reserved words used as column names (if any)
spring.jpa.properties.globally_quoted_identifiers=true
spring.jpa.properties.show-sql=true
spring.jpa.properties.hibernate.naming_strategy=org.hibernate.cfg.EJB3NamingStrategy
management.security.enabled=false
management.health.db.enabled=true
management.health.diskspace.enabled=true
endpoints.health.enabled=true
endpoints.health.sensitive=false
endpoints.metrics.sensitive=false发布于 2016-04-06 20:26:08
Spring只为下列类型的DataSource提供现成的指标
com.zaxxer.hikari.HikariDataSourceorg.apache.commons.dbcp.BasicDataSourceorg.apache.commons.dbcp2.BasicDataSourceorg.apache.tomcat.jdbc.pool.DataSource要获得JBoss的度量标准,您需要提供一个DataSourcePoolMetadataProvider bean,该bean返回特定于JBoss DataSource实现的DataSourcePoolMetaData实现。
https://stackoverflow.com/questions/36459269
复制相似问题