You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[kafka] Add Produce request metrics by reusing RequestsMetrics #4918
I searched in the issues and found no existing issue covering this scope.
Motivation
Kafka Produce requests need request-level metrics consistent with native Fluss RPC requests. Reuse the existing RequestsMetrics implementation so that both protocols use the same metric names, definitions, and recording methods.
Solution
Extend request-name registration in RequestsMetrics and add Kafka entries to RequestsMetrics#metricsByRequest, for example kafkaProduce. A default group is sufficient for other Kafka requests; dedicated metrics for every Kafka API are not required.
Allow the Fluss and Kafka Netty handlers to own separate RequestsMetrics instances. Sharing an instance is not required, but their reported metric namespaces must remain distinct.
Reuse the existing request-level metric set: requestsPerSecond, errorsPerSecond, requestBytes, requestQueueTimeMs, requestProcessTimeMs, responseSendTimeMs, and totalTimeMs. Keep their definitions, sampling boundaries, and calculation/recording methods aligned with the existing Fluss request metrics, without changing the existing Fluss metrics semantics.
Record the necessary timing information on KafkaRequest, including requestDequeTimeMs and requestCompletedTimeMs, and feed it into the same metric-recording code used by native Fluss requests. A shared request-tracking state machine is not needed.
Keep the scope at the request level. Do not add new metrics, per-table metrics, or a separate Kafka metrics implementation.
Focused tests should verify the reused metric names and recording behavior, the kafkaProduce/default request grouping, and namespace isolation between the two protocols.
Anything else?
Parent issue: #4185.
Related implementation PR: #4896.
Activity
pbanakar commentedon Oct 27, 2026
@wuchong @gyang94 I'm intrested to work on this, can i take this one ?