将gerrit指标发送到石墨

时间:2017-09-13 05:31:18

标签: gerrit graphite

我的中心7伏特中有颗粒和石墨。我在gerrit中安装了metrics-reporter-graphite插件。 这是我的metrics-reporter-graphite.config文件

[graphite]
   host = http://127.0.0.1               ## Local host name##
   port = 2003
   prefix = gerrit

但指标不是石墨。这是我的日志文件

[2017-09-13 05:27:08,720] [metrics-graphite-reporter-1-thread-1] WARN  com.codahale.metrics.graphite.GraphiteReporter : Unable to report to Graphite
java.net.UnknownHostException: http://127.0.0.1
       at com.codahale.metrics.graphite.Graphite.connect(Graphite.java:122)
       at com.codahale.metrics.graphite.GraphiteReporter.report(GraphiteReporter.java:240)
       at com.codahale.metrics.ScheduledReporter.report(ScheduledReporter.java:251)
       at com.codahale.metrics.ScheduledReporter$1.run(ScheduledReporter.java:174)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
       at java.lang.Thread.run(Thread.java:748)

1 个答案:

答案 0 :(得分:1)

插件尝试解析给定的主机名并失败:

BETTE

原因是主机名不包含协议,我怀疑石墨实际上是通过端口2003上的HTTP接收数据。所以解决方案是更新配置如下:

java.net.UnknownHostException: http://127.0.0.1