tisonkun commented on code in PR #21249: URL: https://github.com/apache/flink/pull/21249#discussion_r1017342375
########## flink-connectors/flink-connector-pulsar/src/main/java/org/apache/flink/connector/pulsar/source/reader/split/PulsarPartitionSplitReaderBase.java: ########## @@ -222,6 +248,7 @@ protected Consumer<byte[]> createPulsarConsumer(TopicPartition partition) { createConsumerBuilder(pulsarClient, Schema.BYTES, sourceConfiguration); consumerBuilder.topic(partition.getFullTopicName()); + consumerBuilder.intercept(new ConsumerMetricsInterceptor(metricGroup)); Review Comment: ditto ########## 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: Do we also exclude 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