imaffe commented on a change in pull request #18816:
URL: https://github.com/apache/flink/pull/18816#discussion_r809602712



##########
File path: 
flink-connectors/flink-connector-pulsar/src/main/java/org/apache/flink/connector/pulsar/sink/writer/PulsarWriter.java
##########
@@ -124,8 +131,15 @@ public PulsarWriter(
             throw new FlinkRuntimeException("Cannot initialize schema.", e);
         }
 
+        // Initialize metrics
+        this.pulsarSinkWriterMetrics = new 
PulsarSinkWriterMetrics(initContext.metricGroup());
+        this.lastSendTime = PulsarSinkWriterMetrics.INVALID_LAST_SEND_TIME;
         // Create this producer register after opening serialization schema!
-        this.producerRegister = new TopicProducerRegister(sinkConfiguration);
+        this.producerRegister =
+                new TopicProducerRegister(sinkConfiguration, 
pulsarSinkWriterMetrics);

Review comment:
       Consider keep pulsasrSinkWriterMetrics outside of topicProducerRegister, 
instead, all metrics registering code should happen in pulsarWriter.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to