コードで機能するデータソースを構成しましたが、Actuator /metrics エンドポイントでメトリックをレポートすることができません。
私のセットアップは次のとおりです。
- スプリング ブート 1.3.3
- JBoss EAP 6.4 JBoss で定義された JNDI データソース
- Spring Boot の application.properties で構成された JNDI データソース
- Oracle データベース
/heath に表示されます。/configprops エンドポイントで次のことに気付きました。これが問題だと推測していますが、どうすればよいかわかりません。
"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