Grails dropwizard metrics插件没有';t以正确的格式输出度量数据

Grails dropwizard metrics插件没有';t以正确的格式输出度量数据,grails,dropwizard,grails-3.0,grails3,Grails,Dropwizard,Grails 3.0,Grails3,我正在寻找Grails3.x的yammer metrics插件的替代品&找到了同样的Grails Dropwizard metrics 我试图将其与我的示例应用程序(在Grails 3.x中)集成,并遵循以下给出的文档: 在博客之后,我在build.gradle中添加了以下依赖项,即 compile "org.grails.plugins:dropwizard-metrics:1.0.0.BUILD-SNAPSHOT" 为了测试这一点,我使用index()操作制作了TestControlle

我正在寻找Grails3.x的yammer metrics插件的替代品&找到了同样的Grails Dropwizard metrics

我试图将其与我的示例应用程序(在Grails 3.x中)集成,并遵循以下给出的文档:

在博客之后,我在build.gradle中添加了以下依赖项,即

compile "org.grails.plugins:dropwizard-metrics:1.0.0.BUILD-SNAPSHOT"
为了测试这一点,我使用index()操作制作了TestController,即

import grails.plugin.dropwizard.metrics.timers.Timed

class TestController {

    @Timed('test1')
    def index() {
        render 'ok'
    }
}
这样,运行应用程序并点击/test/index,然后点击/metrics,将不再返回有效的JSON,其中包含版本、计量器、计数器、计时器标记等(如中所示)

相反,它只返回以下格式的JSON:

{
    "mem": 830779,
    "mem.free": 602088,
    "processors": 4,
    "instance.uptime": 14766,
    "uptime": 30991,
    "systemload.average": -1.0,
    "heap.committed": 749056,
    "heap.init": 786432,
    "heap.used": 146967,
    "heap": 749056,
    "nonheap.committed": 84896,
    "nonheap.init": 2496,
    "nonheap.used": 81724,
    "nonheap": 0,
    "threads.peak": 33,
    "threads.daemon": 29,
    "threads.totalStarted": 37,
    "threads": 32,
    "classes": 11057,
    "classes.loaded": 11057,
    "classes.unloaded": 0,
    "gc.ps_scavenge.count": 18,
    "gc.ps_scavenge.time": 490,
    "gc.ps_marksweep.count": 3,
    "gc.ps_marksweep.time": 854,
    "test1.snapshot.stdDev": 0,
    "gauge.response.test.test1": 335.0,
    "gauge.response.assets.bootstrap.js": 76.0,
    "test1.snapshot.98thPercentile": 31,
    "counter.status.200.assets.grails.css": 1,
    "gauge.response.assets.jquery-2.2.0.min.js": 146.0,
    "test1.snapshot.999thPercentile": 31,
    "counter.status.200.test.test1": 1,
    "gauge.response.assets.grails-cupsonly-logo-white.svg": 3.0,
    "test1.fifteenMinuteRate": 0.2,
    "test1.snapshot.min": 31,
    "test1.snapshot.95thPercentile": 31,
    "test1.meanRate": 0.18974713564659287,
    "gauge.response.assets.favicon.ico": 8.0,
    "gauge.response.assets.mobile.css": 129.0,
    "gauge.response.root": 2301.0,
    "counter.status.200.root": 1,
    "counter.status.200.assets.jquery-2.2.0.min.js": 1,
    "counter.status.200.assets.application.css": 1,
    "gauge.response.assets.main.css": 148.0,
    "test1.snapshot.mean": 31,
    "test1.snapshot.99thPercentile": 31,
    "counter.status.200.assets.main.css": 1,
    "gauge.response.assets.application.css": 152.0,
    "counter.status.200.assets.mobile.css": 1,
    "counter.status.200.assets.grails-cupsonly-logo-white.svg": 1,
    "test1.snapshot.median": 31,
    "gauge.response.assets.grails.css": 145.0,
    "counter.status.200.assets.bootstrap.js": 1,
    "test1.count": 1,
    "test1.oneMinuteRate": 0.2,
    "test1.fiveMinuteRate": 0.2,
    "test1.snapshot.max": 31,
    "test1.snapshot.75thPercentile": 31,
    "gauge.response.assets.application.js": 4.0,
    "counter.status.200.assets.favicon.ico": 2,
    "counter.status.200.assets.application.js": 1,
    "gauge.response.assets.bootstrap.css": 249.0,
    "counter.status.200.assets.bootstrap.css": 1,
    "httpsessions.max": -1,
    "httpsessions.active": 0
}
在我的示例应用程序中,我尝试在resources.groovy中注册MetricRegistry bean,如下所示:

豆子={ metricRegistry(metricRegistry) }

但输出的JSON仍然是相同的

请告诉我我错过了什么。 提前谢谢