我正在使用Prometheus监视已部署在Flink群集上的应用程序。到目前为止,我可以查询我创建的Codahale/DropWizard
。但是,我知道他们也有一些方法可以让我对数据有更深入的了解。例如,Meter有很多方法,到目前为止,我只能查询我注册的仪表。如何查询方法count
,mark()
或meanRate()
?
public class StationPlatformMapper extends RichMapFunction<MqttSensor, Tuple2<CompositeKeyStationPlatform, MqttSensor>> {
private transient Meter meter;
public void open(Configuration config) throws Exception {
com.codahale.metrics.Meter dropwizardMeter = new com.codahale.metrics.Meter();
this.meter = getRuntimeContext().getMetricGroup().meter(StationPlatformMapper.class.getSimpleName() + "-meter", new DropwizardMeterWrapper(dropwizardMeter));
}
public Tuple2<CompositeKeyStationPlatform, MqttSensor> map(MqttSensor value) throws Exception {
this.meter.markEvent();
return Tuple2.of(compositeKey, value);
}
}