You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Yuepeng Pan (Jira)" <ji...@apache.org> on 2026/08/23 14:56:00 UTC
[jira] [Commented] (FLINK-40292) Add UdfMetrics helper for UDF metrics
[ https://issues.apache.org/jira/browse/FLINK-40292?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18107123#comment-18107123 ]
Yuepeng Pan commented on FLINK-40292:
-------------------------------------
Merged into master(2.4.0) via: 6282650a7545d0e504a43db289a26fac584a5278
> Add UdfMetrics helper for UDF metrics
> -------------------------------------
>
> Key: FLINK-40292
> URL: https://issues.apache.org/jira/browse/FLINK-40292
> Project: Flink
> Issue Type: Sub-task
> Components: Table SQL / Runtime
> Reporter: Weiqing Yang
> Priority: Major
> Labels: pull-request-available
>
> This is the first of four sub-tasks implementing FLIP-485.
> FLIP: [https://cwiki.apache.org/confluence/spaces/FLINK/pages/373885706/FLIP-485+Add+UDF+Metrics]
> Vote thread: [https://lists.apache.org/thread/symqpswsohl2s5wmtkcw0jjp1w5dot0n]
> Add the shared runtime helper {{UdfMetrics}} to flink-table-runtime, in the package org.apache.flink.table.runtime.operators.metrics. It owns metric registration, the sampling decision, timing, and exception counting, and it is the piece that both the synchronous and the asynchronous instrumentation paths use.
> The helper registers two metrics under {{addGroup("udf", udfName)}} on the executing operator's metric group, so the full identifier is {{{}<operator_name>.udf.<udf_name>.<metric>{}}}:
> * {{{}udfProcessingTime{}}}: a DescriptiveStatisticsHistogram of per-invocation nanoseconds.
> It is sampled with the same counter-based scheme as state latency tracking
> (FLINK-21736), including the "sample interval == 1" case that measures every call.
> * {{{}udfExceptionCount{}}}: a ThreadSafeSimpleCounter, incremented on every exception and
> not sampled.
> The histogram is safe to update from an async callback thread. The sampling counter is only advanced on the task thread at dispatch.
> No call site is added here. The first caller arrives in the sub-task that adds the configuration options and instruments synchronous scalar and table UDF calls.
> Covered by a new UdfMetricsTest unit test.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)