I want to monitor the flink app but the problem is...
# troubleshooting
a
I want to monitor the flink app but the problem is only shows as one block , so there is no metric i can see on flink web ui … any recommendation how to monitor it ?
d
what setting do you have for metrics.level in flink-conf.yaml? It can be set to INFO or DEBUG
also make sure that metrics.reporter.<reporter-id>.class is set correctly to a class that is suitable to your monitoring system ie JMX or Prometheus etc
a
https://issues.apache.org/jira/browse/FLINK-7286 this jira ticket tells what my exactly problem is
d
Ok, I wonder if somewhere in your application code you could report this using Flink Metric Group API?
a
The problem this , I don’t have the sourve code of this app , just the jar
d
There is a Kafka Exporter for Prometheus
Other than that .. you could get a rough estimate from network traffic or view it using something like Wireshark if you can run that in your env.
Actually the best solution if you have full control over the deployment but only have access to the jar would be to leave the operators as-is and introduce a ProcessFunction (or Keyed Process Function) and wrap the source with it. The wrapper function would pass through the records as they are but also update counters/metrics
To implement this you just inherit the Keyed/ProcessFunction and implement the processElement method.
Copy code
ctx.forwardElement(element); //to pass downstream without alternation
Copy code
getRuntimeContext().getMetricGroup() // use .counter(..) or .guage(..) methods to report metrics. AFTER the forward.
Keep the implementation of the function very lightweight, and package it in a separate jar.
Test it carefully in staging. This is your best option I think for now.
Also be sure to configure the new operator/process function to be chained if appropriate. Modify the jobs dataflow to include the process function after adding it’s jar to the classpath.
a
I will give a try tomorrow and come back to you
Thanks Draco
d
You’re welcome.
Prometheus using Kafka Exporter is probably the best choice if it works in your environment otherwise custom Process Function.
a
Ok. I will try kafka exporter first
Hi, I tried to use process function and it worked .. Thanks