flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bastien dine <bastien.d...@gmail.com>
Subject Flink - Metric are not reported
Date Tue, 27 Nov 2018 16:00:19 GMT
Hello everyone,

Once again I require your help !
I am trying to report custom metric (see my code below)
Yet, I do not see them anywhere.. nor in the metric tab from my tasks, nor
in the rest API, nor in the declared slf4j reporter..
Can someone help me to debug this ..

Here is my RichMap function :

public class MetricGaugeRichMap<T, E extends MetricTuple<T>> extends
RichMapFunction<E, E> {

    private transient T valueToExpose;
    private final String metricGroup;
    private final String metricName;


    public MetricGaugeRichMap(String metricGroup, String metricName) {
        this.metricGroup = metricGroup;
        this.metricName = metricName;
    }

    @Override
    public void open(Configuration config) {
        getRuntimeContext()
                .getMetricGroup()
                .addGroup(metricGroup)
                .gauge(metricName, (Gauge<T>) () -> valueToExpose);
    }

    @Override
    public E map(E metricTuple) throws Exception {
        valueToExpose = metricTuple.getMetricValue();
        return metricTuple;
    }
}


calling from topology :

env.fromElements(new MetricTuple<>(metricGroup, metricName, metricValue))
    .map(new MetricGaugeRichMap<>(metricGroup, metricName))
    .output(new MetricGaugeOutputFormat<>()); // dummy output


------------------


Bastien DINE
Data Architect / Software Engineer / Sysadmin
bastiendine.io

Mime
View raw message