tisonkun commented on code in PR #21249: URL: https://github.com/apache/flink/pull/21249#discussion_r1017435136
########## flink-connectors/flink-connector-pulsar/src/main/java/org/apache/flink/connector/pulsar/sink/writer/topic/TopicProducerRegister.java: ########## @@ -150,7 +181,13 @@ private <T> Producer<T> getOrCreateProducer(String topic, Schema<T> schema) { createProducerBuilder(pulsarClient, schema, sinkConfiguration); // Set the required topic name. builder.topic(topic); + // Set the sending counter for metrics. + builder.intercept(new ProducerMetricsInterceptor(metricGroup)); Review Comment: Although I think logically we should skip adding this interceptor if metrics are disabled. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org