You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by li...@apache.org on 2026/10/15 10:18:34 UTC

(rocketmq-dashboard) branch rocketmq-studio updated: fix(clients): stop scoring proxy rows as unknown-protocol anomalies (#6673)

This is an automated email from the ASF dual-hosted git repository.

lizhimins pushed a commit to branch rocketmq-studio
in repository https://gitbox.apache.org/repos/asf/rocketmq-dashboard.git


The following commit(s) were added to refs/heads/rocketmq-studio by this push:
     new c1742744a fix(clients): stop scoring proxy rows as unknown-protocol anomalies (#6673)
c1742744a is described below

commit c1742744a58dbe1b18d25a61cffc4f893cf876d3
Author: messere <73...@qq.com>
AuthorDate: Thu Oct 15 18:18:28 2026 +0800

    fix(clients): stop scoring proxy rows as unknown-protocol anomalies (#6673)
---
 web/src/utils/clientConnectionDiagnostics.test.ts | 28 +++++++++++++++++++++++
 web/src/utils/clientConnectionDiagnostics.ts      | 16 +++++++++----
 2 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/web/src/utils/clientConnectionDiagnostics.test.ts b/web/src/utils/clientConnectionDiagnostics.test.ts
index 1c8912c64..5bf2ab3be 100644
--- a/web/src/utils/clientConnectionDiagnostics.test.ts
+++ b/web/src/utils/clientConnectionDiagnostics.test.ts
@@ -205,6 +205,34 @@ describe('client connection diagnostics', () => {
     );
   });
 
+  it('does not report proxy rows for the protocol and version the Proxy response cannot carry', () => {
+    // Proxy-derived rows have no protocol/version by design (the server comments "The Proxy
+    // response has no protocol"), and the clients page even gives them a dedicated
+    // unknown-protocol filter sentinel. Scoring them as anomalies cost 18 points per row:
+    // three gRPC consumers behind a proxy flipped the panel to "high risk" while nothing
+    // was wrong.
+    const proxyRow = (clientId: string, address: string): ClientConnection =>
+      connection({
+        clientId,
+        address,
+        type: 'Consumer',
+        groupOrTopic: 'cg-order',
+        protocol: null,
+        version: null,
+      });
+
+    const diagnostics = analyzeClientConnections([
+      proxyRow('consumer-a', '10.0.2.10:49152'),
+      proxyRow('consumer-b', '10.0.2.11:49152'),
+      proxyRow('consumer-c', '10.0.2.12:49152'),
+    ]);
+
+    expect(diagnostics.issues.map((item) => item.code)).not.toContain('UNKNOWN_PROTOCOL');
+    expect(diagnostics.issues.map((item) => item.code)).not.toContain('UNKNOWN_VERSION');
+    expect(diagnostics.status).toBe('healthy');
+    expect(diagnostics.score).toBe(100);
+  });
+
   it('detects unknown fields, invalid timestamps, and address concentration', () => {
     const diagnostics = analyzeClientConnections([
       connection({
diff --git a/web/src/utils/clientConnectionDiagnostics.ts b/web/src/utils/clientConnectionDiagnostics.ts
index e9d9029d4..094f70c68 100644
--- a/web/src/utils/clientConnectionDiagnostics.ts
+++ b/web/src/utils/clientConnectionDiagnostics.ts
@@ -294,7 +294,12 @@ const addUnknownFieldIssues = (
     const language = normalizeText(connection.language);
     const version = normalizeText(connection.version);
 
-    if (!KNOWN_PROTOCOLS.has(protocol)) {
+    // A proxy-derived row carries no protocol and no version by design (the Proxy response
+    // has neither — the clients page renders those rows with a dedicated unknown-protocol
+    // filter sentinel). An absent field is that expected shape, not an anomaly: warning on
+    // it scored every gRPC consumer behind a proxy 18 points, and three such rows flipped
+    // the panel to "high risk". Only a present-but-unrecognized value is worth a warning.
+    if (connection.protocol && !KNOWN_PROTOCOLS.has(protocol)) {
       issues.push(
         issue(
           'UNKNOWN_PROTOCOL',
@@ -330,7 +335,7 @@ const addUnknownFieldIssues = (
       );
     }
 
-    if (version === 'unknown' || version === '-') {
+    if (connection.version != null && (version === 'unknown' || version === '-')) {
       issues.push(
         issue(
           'UNKNOWN_VERSION',
@@ -571,15 +576,16 @@ const buildRecommendations = (issues: ClientConnectionIssue[]): string[] => {
 export const analyzeClientConnections = (
   connections: ClientConnection[],
 ): ClientConnectionDiagnostics => {
+  // Only the identity fields are normalized up front. protocol/language/version stay raw so
+  // the unknown-field checks can tell "the Proxy response carries no protocol/version" (an
+  // expected shape, rendered with a dedicated unknown sentinel on the clients page) apart
+  // from a present-but-unrecognized value; every other consumer normalizes at point of use.
   const normalizedConnections = connections.map((connection) => ({
     ...connection,
     clientId: normalizeText(connection.clientId),
     type: normalizeText(connection.type),
     groupOrTopic: normalizeText(connection.groupOrTopic),
-    protocol: normalizeText(connection.protocol),
     address: normalizeText(connection.address),
-    language: normalizeText(connection.language),
-    version: normalizeText(connection.version),
   }));
   const groups = groupConnections(normalizedConnections);
   const issues: ClientConnectionIssue[] = [];