I have a time series logs processed by Apache Flink, and I want to plot the data of grafana, by first exporting it to Prometheus. Is there any example or a way to do so in java. Something like writing a custom sink in flink which will continuously sink data into prometheus.
6
-
So what is the problem? Have you tried something? Or you expect someone to code the sink for you? :) Flink Docs: ci.apache.org/projects/flink/flink-docs-master/dev/… First search on Google: bytefish.de/blog/apache_flink_series_4– AlexMar 14, 2018 at 21:49
-
Actually, tried a lot. Read about Java client , flink documentation and lot of other sources over 2 days and did not get anything. I am here for a direction.– Srivatsa SinhaMar 15, 2018 at 3:40
-
Also I have already visited those links. :-)– Srivatsa SinhaMar 15, 2018 at 4:45
-
If it is a small number of values, the hack I have done is basically a null sink which exposes metrics from the values that are written to it. Then you just use the PrometheusMetricsReporter which will poll it. But this limits your time granularity and also does not give you fine control over the labels– Joshua DeWaldMar 15, 2018 at 15:50
-
2This would be easy to do with the influxdb sink and grafana. Does it have to be Prometheus? There's an influxdb sink here: github.com/apache/bahir-flink/tree/master/…– David AndersonMar 15, 2018 at 22:05
|
Show 1 more comment
1 Answer
I think you may be looking for the Flink Metrics reporter which is available in current versions of Flink. It allows for reporting to Prometheus.
https://ci.apache.org/projects/flink/flink-docs-stable/deployment/metric_reporters.html