如何将Apache Storm中的延迟指标发送到Graphite服务器?

问题描述 投票:0回答:1

我已将Apache Storm配置为使用version 2将指标发送到Graphite服务器。它发送了我所有螺栓和喷口的count参数。我想发送螺栓和喷口的通信之间的延迟,以及处理它们上的每个元组的时间。但是,我在Graphite服务器上找到的所有内容都是与螺栓和喷口上的count元组相关的指标。文档说可以收集直方图,定时器等。但是没有解释如何收集它。

# Metrics v2 configuration (optional)
storm.metrics.reporters:
  # Graphite Reporter
  - class: "org.apache.storm.metrics2.reporters.GraphiteStormReporter"
    daemons:
        - "supervisor"
        - "nimbus"
        - "worker"
    report.period: 30
    report.period.units: "SECONDS"
    graphite.host: "127.0.0.1"
    graphite.port: 2003

enter image description here

apache-storm graphite
1个回答
0
投票

我在所有Bolts上都包含了一个Meter,现在它已经在Graphite Web服务器上显示了。

public class MqttSensorDetailSpout extends BaseRichSpout {
    ...
    private Meter tupleMeter;
    public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {
        this.tupleMeter = context.registerMeter("meterSpout-" + this.topic);
    }
    public void nextTuple() {
        this.tupleMeter.mark();
        ...
    }
}

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.