You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "asafm (via GitHub)" <gi...@apache.org> on 2024/03/03 14:15:33 UTC

Re: [PR] [feat][misc] PIP-264: Implement topic lookup metrics using OpenTelemetry [pulsar]

asafm commented on code in PR #22058:
URL: https://github.com/apache/pulsar/pull/22058#discussion_r1510284781


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java:
##########
@@ -175,6 +187,25 @@ public NamespaceService(PulsarService pulsar) {
         this.bundleSplitListeners = new CopyOnWriteArrayList<>();
         this.localBrokerDataCache = pulsar.getLocalMetadataStore().getMetadataCache(LocalBrokerData.class);
         this.redirectManager = new RedirectManager(pulsar);
+
+        var meter = pulsar.getOpenTelemetry().getMeter();
+        this.lookupRedirectsCounter = meter
+                .counterBuilder("pulsar.broker.lookup.redirect")
+                .setDescription("The number of lookup redirected requests")
+                .build();
+        this.lookupFailuresCounter = meter
+                .counterBuilder("pulsar.broker.lookup.failure")
+                .setDescription("The number of lookup failures")
+                .build();
+        this.lookupAnswersCounter = meter
+                .counterBuilder("pulsar.broker.lookup.answer")
+                .setDescription("The number of lookup responses (i.e. not redirected requests)")
+                .build();
+        this.lookupLatencyHistogram = meter
+                .histogramBuilder("pulsar.broker.lookup.latency")

Review Comment:
   @codelipenghui The attribute name is `pulsar.lookup.response.type`, and it can have the following values: `broker` or `redirect`. We are not placing the actual URL as the attribute value.
   
   Given this, are you ok with the 2 attributes suggested and the name?
   
   Name = `pulsar.broker.lookup.request.duration`
   Attributes:
   1. `pulsar.lookup.response.type`: values can be `broker`, `redirect`
   2. `pulsar.response.status`: values can be `success`, `failure`
   



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org