Skip to content

Add systematic tracing for control message encode/decode#1144

Merged
kixelated merged 2 commits intomainfrom
next-group
Mar 21, 2026
Merged

Add systematic tracing for control message encode/decode#1144
kixelated merged 2 commits intomainfrom
next-group

Conversation

@kixelated
Copy link
Collaborator

Summary

  • Centralize protocol message logging in the Message trait blanket impls for both lite and IETF, replacing 22 scattered trace! calls
  • On encode: log the message at TRACE level before encoding
  • On decode: conditional path — when TRACE is enabled, capture raw bytes via copy_to_bytes for diagnostics (logged on failure as warn!); when disabled, use the zero-copy buf.take() path with no overhead
  • Add trace logging for IETF GroupHeader which implements Encode/Decode directly
  • Remove noisy operational trace lines (frame sizes, group lifecycle) that obscured actual protocol messages

Test plan

  • just check passes — all tests and linting
  • Run relay with RUST_LOG=moq_lite=trace and verify trace output shows encoded/decoded messages
  • Verify warn! output on malformed input includes raw bytes at TRACE level

🤖 Generated with Claude Code

Centralize protocol message logging in the Message trait blanket impls
instead of scattering trace! calls throughout the codebase. On encode,
log the message at TRACE level. On decode, use a conditional path: when
TRACE is enabled, capture raw bytes via copy_to_bytes for diagnostics;
when disabled, use the zero-copy buf.take() path. Decode failures always
warn, with raw bytes included only at TRACE level.

Also add trace logging for IETF GroupHeader (which implements
Encode/Decode directly rather than via Message), and remove 22 scattered
trace! lines that logged noisy operational details (frame sizes, group
lifecycle) rather than actual messages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5952322e-cc1f-49b6-9038-97f2e2609a34

📥 Commits

Reviewing files that changed from the base of the PR and between 17554ff and 4c1657d.

📒 Files selected for processing (10)
  • rs/moq-lite/src/client.rs
  • rs/moq-lite/src/ietf/adapter.rs
  • rs/moq-lite/src/ietf/group.rs
  • rs/moq-lite/src/ietf/message.rs
  • rs/moq-lite/src/ietf/publisher.rs
  • rs/moq-lite/src/ietf/subscriber.rs
  • rs/moq-lite/src/lite/message.rs
  • rs/moq-lite/src/lite/publisher.rs
  • rs/moq-lite/src/lite/subscriber.rs
  • rs/moq-lite/src/server.rs
💤 Files with no reviewable changes (7)
  • rs/moq-lite/src/ietf/publisher.rs
  • rs/moq-lite/src/server.rs
  • rs/moq-lite/src/client.rs
  • rs/moq-lite/src/lite/subscriber.rs
  • rs/moq-lite/src/ietf/adapter.rs
  • rs/moq-lite/src/ietf/subscriber.rs
  • rs/moq-lite/src/lite/publisher.rs

Walkthrough

This pull request consolidates tracing statements across the MOQ lite implementation. It removes multiple tracing::trace! log statements from client, server, publisher, and subscriber control flow paths (totaling removals of 2, 2, 1, 7, 9, and 8 lines across respective modules). Concurrently, it adds trace logging at the message encoding/decoding boundary layer by instrumenting GroupHeader serialization and reworking message decode logic to conditionally validate buffer length, log decoding outcomes, and emit warnings on decode failures. The net effect shifts observability focus from high-level control flow events to lower-level message transformation events.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main objective: centralizing systematic tracing for control message encode/decode operations across the codebase.
Description check ✅ Passed The description is directly related to the changeset, detailing the consolidation of trace logging into Message trait impls, conditional TRACE paths, and removal of noisy operational traces.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch next-group
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch next-group

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kixelated kixelated enabled auto-merge (squash) March 21, 2026 16:22
@kixelated kixelated merged commit 8b1d09c into main Mar 21, 2026
2 checks passed
@kixelated kixelated deleted the next-group branch March 21, 2026 16:44
@moq-bot moq-bot bot mentioned this pull request Mar 21, 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.

1 participant