Skip to content

[ISSUE #10676] Sanitize telemetry exception logs - #10677

Closed
Aias00 wants to merge 1 commit into
apache:developfrom
Aias00:fix/proxy-telemetry-exception-summary
Closed

[ISSUE #10676] Sanitize telemetry exception logs#10677
Aias00 wants to merge 1 commit into
apache:developfrom
Aias00:fix/proxy-telemetry-exception-summary

Conversation

@Aias00

@Aias00 Aias00 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace full inbound TelemetryCommand logging in ClientActivity.processTelemetryException with a compact request summary.
  • Preserve diagnostic fields such as command type, status code, nonce, client type, and pub/sub case.
  • Add coverage to ensure thread stack trace telemetry content is omitted from summaries.

Motivation

Closes #10676.

When client telemetry processing fails with an internal error, the previous warning log serialized the full protobuf request via request:{}. Client telemetry may include verbose or sensitive runtime details such as thread stack traces, so logs should stay bounded and diagnostic-focused.

Tests

  • mvn -pl proxy -Dtest=ClientActivityTest -DfailIfNoTests=false test

Result: BUILD SUCCESS; 16 tests passed; checkstyle reported 0 violations. The run emits existing JaCoCo instrumentation warnings under the local JDK, but tests and build completed successfully.

Copilot AI review requested due to automatic review settings July 29, 2026 03:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 37.50000% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.22%. Comparing base (00e45b8) to head (1725efd).

Files with missing lines Patch % Lines
.../rocketmq/proxy/grpc/v2/client/ClientActivity.java 37.50% 7 Missing and 3 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10677      +/-   ##
=============================================
- Coverage      48.31%   48.22%   -0.10%     
+ Complexity     13511    13480      -31     
=============================================
  Files           1380     1380              
  Lines         101091   101106      +15     
  Branches       13101    13103       +2     
=============================================
- Hits           48844    48758      -86     
- Misses         46285    46360      +75     
- Partials        5962     5988      +26     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by github-manager-bot

Summary

Replaces full protobuf serialization in exception logs with a compact diagnostic summary, preventing sensitive data (e.g., thread stack traces) from leaking into log output.

Findings

  • [Info] — The method correctly extracts diagnostic fields (command type, status code, nonce, client type) while omitting potentially sensitive payloads.
  • [Info] — The on is well-structured. correctly includes only the nonce and omits the actual stack trace content.
  • [Info] — Test explicitly verifies that the secret stack trace string does NOT appear in the summary. Good negative assertion.

Suggestions

  • [Info] Consider adding a case test that verifies and appear in the summary, for completeness of the branch coverage. Minor — not blocking.

Automated review by github-manager-bot

@RockteMQ-AI

Copy link
Copy Markdown
Contributor

Review by github-manager-bot

Summary

Replaces full protobuf TelemetryCommand serialization in exception logs with a compact diagnostic summary, preventing sensitive data (e.g., thread stack traces) from leaking into log output.

Findings

  • [Info] ClientActivity.java:365 — The summarizeTelemetryCommand method correctly extracts diagnostic fields (command type, status code, nonce, client type) while omitting potentially sensitive payloads.
  • [Info] ClientActivity.java:375-393 — The switch on commandCase is well-structured. THREAD_STACK_TRACE correctly includes only the nonce and omits the actual stack trace content.
  • [Info] ClientActivityTest.java:420 — Test explicitly verifies that the secret stack trace string does NOT appear in the summary. Good negative assertion.

Suggestions

  • [Info] Consider adding a SETTINGS case test that verifies clientType and pubSubCase appear in the summary, for completeness of the switch branch coverage. Minor — not blocking.

Automated review by github-manager-bot

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Defensive fix with proper validation and test coverage. LGTM.


Automated review by github-manager-bot

@Aias00

Aias00 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

Consolidated into #10717; both changes sanitize ClientActivity telemetry and Settings diagnostics.

@Aias00 Aias00 closed this Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Proxy gRPC telemetry exception logs full client TelemetryCommand

4 participants