codelipenghui commented on code in PR #25304:
URL: https://github.com/apache/pulsar/pull/25304#discussion_r2920544521
##########
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:
For V2 ledger names this is a bugfix (old code incorrectly included domain
in namespace label). But for V1 ledger names still in storage
(`tenant/cluster/namespace/domain/topic`), this returns `tenant/cluster`
instead of the correct namespace.
Also, even for V2, this changes the metrics `namespace` dimension from
`tenant/namespace/domain` to `tenant/namespace`, which will break existing
dashboards and alerts.
Should be documented as a known breaking change in release notes.
--
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]