merlimat commented on code in PR #22179:
URL: https://github.com/apache/pulsar/pull/22179#discussion_r1511771322


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -386,7 +402,30 @@ protected ConsumerImpl(PulsarClientImpl client, String 
topic, ConsumerConfigurat
 
         topicNameWithoutPartition = topicName.getPartitionedTopicName();
 
+        InstrumentProvider ip = client.instrumentProvider();
+        Attributes attrs = ip.getAttributes(topic);
+        consumersOpenedCounter = ip.newCounter("pulsar.client.session.opened", 
Unit.Sessions,
+                "Counter of sessions opened", attrs.toBuilder().put("type", 
"consumer").build());
+        consumersClosedCounter = ip.newCounter("pulsar.client.session.closed", 
Unit.Sessions,
+                "Counter of sessions closed", attrs.toBuilder().put("type", 
"consumer").build());
+        messagesReceivedCounter = ip.newCounter("pulsar.client.received", 
Unit.Messages,

Review Comment:
   I'm not sure I understand: the `attrs` are going to be at topic/namespace or 
whatever level is configured.



-- 
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