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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/metrics/AbstractMetrics.java:
##########
@@ -173,7 +173,9 @@ protected String parseNamespaceFromLedgerName(String 
ledgerName) {
         Matcher m = V2_LEDGER_NAME_PATTERN.matcher(ledgerName);
 
         if (m.matches()) {
-            return m.group(1);
+            // Ledger name format: tenant/namespace/domain/topic
+            // Extract only tenant/namespace (groups 2 and 3), excluding the 
domain.
+            return m.group(2) + "/" + m.group(3);

Review Comment:
   > But for V1 ledger names still in storage 
(tenant/cluster/namespace/domain/topic), this returns tenant/cluster instead of 
the correct namespace.
   
   I think it's fine to assume there no more v1 topics at this point.
   
   > Also, even for V2, this changes the metrics namespace dimension from 
tenant/namespace/domain to tenant/namespace, which will break existing 
dashboards and alerts.
   
   Ok. I'll keep the same "wrong" label for v2. We can decide to change it 
separately.



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