0

我已经设置了一个 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 上什么也没有出现。我在这里做错了什么?我需要为石墨指定任何其他配置吗?安装石墨后,我没有添加任何配置。任何帮助将不胜感激。

4

1 回答 1

1

InetSocketAddress您创建的点指向localhostport 80。你在那个港口本地运行碳吗?通常,Web 界面将在 Apache 或 nginx 之后在端口上运行,80并且carbon-cache进程(实际上从 接收指标GraphiteReporter)将在端口上运行2003

在标准设置中,它应该只是在您的构造函数中使用交换机端口80的情况。2003InetSocketAddress

于 2016-12-17T21:47:14.313 回答