Metric name collision

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Metric name collision

rharlin
Hi,

I'm trying to add some custom metrics for a Flink job, but have bumped into some issues using the PrometheusReporter.  If I'm running multiple instances of the same job under the same TaskManager, I'm seeing the following error when the second instance of the job tries to create the metric with the same name:  

2018-06-13 11:17:42,512 ERROR org.apache.flink.runtime.metrics.MetricRegistry               - Error while registering metric.
java.lang.IllegalArgumentException: Collector already registered that provides name: flink_taskmanager_job_task_operator_myMetric

This is preventing the metric from being created properly.  I can work around this by putting the task_attempt_id or some other uuid in the metric name to avoid the collision, but this causes extra clutter and orphaned metrics if the job restarts.  Has anyone else run into this?  Is there a better approach for handling it?

Thanks,

Russell

Reply | Threaded
Open this post in threaded view
|

Re: Metric name collision

rharlin
Right after I sent this, I realized that FLINK-7502 is likely the fix that
I'm looking for.  I swapped in a more recent version of the
flink-metrics-prometheus jar and it seems to be much happier now.

Thanks,

Russell



--
Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/