我有一个使用Docker和Kubernetes在Google Cloud Platform上运行的Web应用程序。我们正在使用Datadog版本5来可视化我们的指标,并且它已经与我们的系统集成在一起。
我的问题是我启用了Hibernate JMX报告(已通过JConsole验证,可以正常工作),但是我无法找出正确的配置来在Datadog中启用这些指标。
我按照this的文章进行了集成,但是对于Hibernate,它看起来有点不同,请参见下面的两个图像(Hibernate在JConsole上的外观)。 涂黑的文字是我们的应用名称):
这是我们使用的有效datadog配置:
annotations:
service-discovery.datadoghq.com/web-api-new-vpc.check_names: '["jmx"]'
service-discovery.datadoghq.com/web-api-new-vpc.init_configs: '[{}]'
service-discovery.datadoghq.com/web-api-new-vpc.instances: >
[{
"host": "%%host%%","jmx_url": "service:jmx:rmi:///jndi/rmi://%%host%%:4567/jmxrmi","tags": {"kubernetes_pod_name":"%%host%%"},"conf": [{
"include": {
"domain": "metrics","attribute": [
"99thPercentile","Count","Max","Mean","OneMinuteRate","RateUnit","Value"
]
}
},{
"include": {
"domain": "org.eclipse.jetty.server","attribute": [
"acceptQueueSize"
]
}
}]
}]
根据我链接的教程,这是我尝试过的:
annotations:
service-discovery.datadoghq.com/web-api-new-vpc.check_names: '["jmx"]'
service-discovery.datadoghq.com/web-api-new-vpc.init_configs: '[{}]'
service-discovery.datadoghq.com/web-api-new-vpc.instances: >
[
{
"host": "%%host%%","tags": {
"kubernetes_pod_name": "%%host%%"
},"conf": [
{
"include": {
"domain": "metrics","attribute": [
"99thPercentile","Value"
]
}
},{
"include": {
"domain": "org.eclipse.jetty.server","attribute": [
"acceptQueueSize"
]
}
},{
"include": {
"domain": "org.hibernate.core","bean": "org.hibernate.core:sessionFactory=my-application,serviceRole=org.hibernate.stat.spi.StatisticsImplementor,serviceType=org.hibernate.stat.internal.StatisticsImpl","attribute": [
{
"QueryExecutionCount": {
"alias": "hibernate.queryexecutioncount"
}
},{
"EntityLoadCount": {
"alias": "hibernate.entityloadcount"
}
}
]
}
}
]
}
]
我很确定我的问题只是配置条目的问题,但是到目前为止,我仍无法找出正确的问题。