【问题标题】:Send gerrit metrics to graphite将 gerrit 指标发送到石墨
【发布时间】:2017-09-13 05:31:18
【问题描述】:

我的 centos 7 虚拟机中有 gerrit 和石墨。我在 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)

【问题讨论】:

    标签: gerrit graphite


    【解决方案1】:

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

    java.net.UnknownHostException: http://127.0.0.1
    

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

    [graphite]
       host = 127.0.0.1
       // ...
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多