Skip to content

[ISSUE #10672] Sanitize proxy telemetry failure logs - #10673

Open
Aias00 wants to merge 3 commits into
apache:developfrom
Aias00:fix/proxy-telemetry-log-summary
Open

[ISSUE #10672] Sanitize proxy telemetry failure logs#10673
Aias00 wants to merge 3 commits into
apache:developfrom
Aias00:fix/proxy-telemetry-log-summary

Conversation

@Aias00

@Aias00 Aias00 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace full TelemetryCommand logging in GrpcClientChannel.writeTelemetryCommand with a compact command summary.
  • Preserve useful runtime diagnostics such as command type, nonce, transaction ID, client type, and channel context.
  • Add coverage to ensure message payloads are not included in telemetry command summaries.

Motivation

Closes #10672.

Proxy gRPC telemetry write failures can happen after a client disconnects or when the telemetry stream is completed. The previous warning logs serialized the full protobuf command, which can include message payloads for commands such as VerifyMessageCommand and RecoverOrphanedTransactionCommand.

Review feedback addressed

  • Mark RECOVER_ORPHANED_TRANSACTION_COMMAND summaries with details omitted to make intentional field exclusion explicit.
  • Add a maintenance comment for future telemetry commands that may carry sensitive payloads.
  • Add a regression test for RecoverOrphanedTransactionCommand payload redaction.
  • Improve summarizeTelemetryCommand coverage for null/default commands, settings commands, thread-stack trace commands, and lite unsubscribe notifications.

Tests

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

Result: BUILD SUCCESS; 4 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:26

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.

@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 TextFormat.shortDebugString(command) logging in GrpcClientChannel.writeTelemetryCommand with a compact summarizeTelemetryCommand() method that logs only diagnostic-relevant fields (command type, nonce, transaction ID, client type, channel context) without exposing message payloads. Also adds missing channel context to the catch-block warning.

Findings

  • [Info] GrpcClientChannel.java:289 — The <<<TRUNCATED>>> marker in RECOVER_ORPHANED_TRANSACTION_COMMAND is clear, but consider (details omitted) or similar to better convey that fields are intentionally excluded rather than truncated mid-stream. Very minor.

  • [Info] GrpcClientChannel.java:296 — The default branch returns only the command case name. If future command types carry sensitive payloads, developers must remember to add explicit cases here. A brief comment like // Add explicit cases for commands with sensitive payloads would help future maintainers.

  • [Info] GrpcClientChannelTest.java — Test correctly verifies that VERIFY_MESSAGE_COMMAND summary does not leak message body content. Good coverage of the key invariant. Consider adding a test for the RECOVER_ORPHANED_TRANSACTION_COMMAND case as well, since that is the other command type explicitly called out in the issue.

Overall

Clean, well-targeted fix. The approach correctly addresses the payload leakage concern while preserving useful diagnostic information. No correctness, performance, or compatibility issues found.


Automated review by github-manager-bot

@codecov-commenter

codecov-commenter commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.24%. Comparing base (00e45b8) to head (b5c898b).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10673      +/-   ##
=============================================
- Coverage      48.31%   48.24%   -0.07%     
+ Complexity     13511    13488      -23     
=============================================
  Files           1380     1380              
  Lines         101091   101112      +21     
  Branches       13101    13102       +1     
=============================================
- Hits           48844    48784      -60     
- Misses         46285    46345      +60     
- Partials        5962     5983      +21     

☔ 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 (Re-review)

PR #10673: [ISSUE #10672] Sanitize proxy telemetry failure logs
Re-review scope: New commits a94c20b ("Address telemetry log review feedback") and b5c898b ("Improve telemetry summary test coverage")

Changes Since Last Review

  • summarizeTelemetryCommand() expanded to cover additional command types with diagnostic-relevant fields
  • Added channel context (this) to the catch-block warning for better traceability
  • Improved test coverage for the telemetry summary method

Assessment

Correctness — The summary method correctly avoids exposing message payloads while providing useful diagnostic information.
Tests — Good coverage of the various telemetry command types.
Security — No sensitive data leakage in the sanitized log output.

Overall: LGTM — Feedback well addressed, clean implementation.


Automated re-review by github-manager-bot

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 write failure logs full TelemetryCommand payload

4 participants