Hi Mason, I'm afraid there is no way for users to actively remove/unregister metrics. These things are automatically completed by the Flink engine after the job finishes.
Here is a very hacky way to achieve this. After you think the UDF with metrics registration has already processed all it's business, you could stop the job with savepoint, update the UDF to delete code which defines metrics, then restore the job from savepoint. I admit the solution is very hacky, however I don't know a better way yet. BTW, Would you please explain why you need to remove/unregister metrics actively? Best, JING ZHANG Mason Chen <[email protected]> 于2021年10月15日周五 上午8:43写道: > Hi all, > > Suppose I have a short lived process within a UDF that defines metrics. > After the process has completed, the underlying resources should be cleaned > up. Is there an API to remove/unregister metrics? > > Best, > Mason >
