我已经设置了一个 Graphite 服务器,我正在尝试将我的 Java 指标打印到 Graphite UI 中。Graphite 已启动并正在运行,因为我可以在 localhost 中看到它的 Web UI。我使用下面的代码将我的指标结果重定向到石墨控制台。
Graphite graphite = new Graphite(new InetSocketAddress("http://localhost", 80));
GraphiteReporter reporter = GraphiteReporter.forRegistry(this.metricRegistry)
.convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.MILLISECONDS)
.filter(MetricFilter.ALL)
.build(graphite);
reporter.start(1, TimeUnit.MINUTES);
但是 Web UI 上什么也没有出现。我在这里做错了什么?我需要为石墨指定任何其他配置吗?安装石墨后,我没有添加任何配置。任何帮助将不胜感激。