Skip to content

[ISSUE #8084]♻️Route core service entries through unified telemetry bootstrap#8085

Merged
mxsm merged 1 commit into
mainfrom
mxsm/core-services-unified-telemetry-bootstrap
Jul 6, 2026
Merged

[ISSUE #8084]♻️Route core service entries through unified telemetry bootstrap#8085
mxsm merged 1 commit into
mainfrom
mxsm/core-services-unified-telemetry-bootstrap

Conversation

@mxsm

@mxsm mxsm commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Which Issue(s) This PR Fixes(Closes)

Brief Description

This PR routes the NameServer, Proxy, and Controller binary entries through the unified telemetry logging bootstrap.

Changes include:

  • Build service-specific TelemetryBootstrapConfig values for NameServer, Proxy, and Controller.
  • Require global subscriber installation for these core service entries.
  • Keep print-config paths free of global telemetry side effects.
  • Hold the telemetry guard until service shutdown and propagate bootstrap shutdown errors.
  • Replace remaining stderr-only shutdown diagnostics with structured tracing warnings.
  • Add focused binary tests for the bootstrap defaults used by each service.

How Did You Test This Change?

  • cargo fmt --all passed.
  • cargo test -p rocketmq-namesrv --all-features passed.
  • cargo test -p rocketmq-controller --all-features passed.
  • cargo test -p rocketmq-proxy --bin rocketmq-proxy-rust --all-features passed.
  • cargo clippy --workspace --no-deps --all-targets --all-features -- -D warnings passed with a clean C-drive temporary target directory.
  • cargo test -p rocketmq-proxy --all-features was also run, but it fails in existing auth and ACL library tests unrelated to this PR. The failure was reproduced on clean main with cargo test -p rocketmq-proxy auth::tests::map_authorization_error_preserves_proxy_error_category --all-features.

Summary by CodeRabbit

  • New Features

    • Improved startup logging and telemetry across the controller, NameServer, and proxy.
    • Added clearer configuration output during launch for easier troubleshooting.
  • Bug Fixes

    • Replaced abrupt exit handling with more graceful startup and shutdown behavior.
    • Improved Ctrl-C handling so shutdown warnings are logged consistently.
    • Added better validation for required environment setup before services start.

@mxsm mxsm merged commit af20cd6 into main Jul 6, 2026
5 of 7 checks passed
@mxsm mxsm deleted the mxsm/core-services-unified-telemetry-bootstrap branch July 6, 2026 16:55
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3e48b9f5-7bd9-44a3-8ee3-a4b78787edf1

📥 Commits

Reviewing files that changed from the base of the PR and between 1acdd56 and 00a2466.

📒 Files selected for processing (3)
  • rocketmq-controller/src/bin/controller_bootstrap.rs
  • rocketmq-namesrv/src/bin/namesrv_bootstrap_server.rs
  • rocketmq-proxy/src/bin/rocketmq-proxy-rust.rs

Walkthrough

Controller, NameServer, and Proxy bootstrap binaries are refactored to install a unified telemetry logging bootstrap via install_global, replacing prior direct logger initialization. Config-related helper functions build service-specific TelemetryBootstrapConfig objects, log bootstrap details, and shut down telemetry guards on exit; error handling switches from process::exit/eprintln! to anyhow-based bail!/Context propagation. Unit tests validate bootstrap config defaults for each service.

Changes

Unified telemetry bootstrap across bootstrap binaries

Layer / File(s) Summary
Controller bootstrap telemetry integration
rocketmq-controller/src/bin/controller_bootstrap.rs
Installs telemetry via install_global, moves ASCII logo to a const, replaces eprintln!+process::exit with bail!/shutdown().await?, adds build_controller_telemetry_bootstrap_config, controller_log_directory, log_telemetry_bootstrap helpers, and unit tests for bootstrap defaults.
NameServer bootstrap telemetry integration
rocketmq-namesrv/src/bin/namesrv_bootstrap_server.rs
Removes std::process/tracing::error imports, installs telemetry via build_namesrv_telemetry_bootstrap_config + install_global, replaces exit-on-print-config with non-terminating print_config, maps boot errors and combines with telemetry shutdown, adds unit tests.
Proxy bootstrap telemetry integration
rocketmq-proxy/src/bin/rocketmq-proxy-rust.rs
Removes direct logger init, builds telemetry config via build_proxy_telemetry_bootstrap_config, installs telemetry (mapping failures to ProxyError::Transport), switches ctrl-c handling to tracing::warn!, combines runtime and telemetry shutdown results, adds log_telemetry_bootstrap and unit tests.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant Bootstrap as run()
  participant Telemetry as TelemetryBootstrap
  participant Service as ServiceRuntime

  CLI->>Bootstrap: parse config / CLI args
  Bootstrap->>Bootstrap: validate ROCKETMQ_HOME (bail! on error)
  Bootstrap->>Telemetry: build config + install_global()
  Telemetry-->>Bootstrap: telemetry guard
  Bootstrap->>Service: start (run_controller / boot / serve_with_shutdown)
  Service-->>Bootstrap: runtime result / ctrl-c signal
  Bootstrap->>Service: shutdown()
  Bootstrap->>Telemetry: shutdown guard
  Telemetry-->>Bootstrap: shutdown result
  Bootstrap-->>CLI: combined Result
Loading

Possibly related issues

Possibly related PRs

  • mxsm/rocketmq-rust#7545: Both PRs modify the same proxy entrypoint startup/shutdown flow in rocketmq-proxy/src/bin/rocketmq-proxy-rust.rs.

Suggested labels: feature🚀, approved, auto merge, AI review first

Suggested reviewers: SpaceXCN, TeslaRustor, rocketmq-rust-bot

Poem

Three bunnies boot with logs aglow,
Telemetry guards now safely stow,
No more exits crashing loud,
Just traces warm within the cloud,
Hop, shutdown, and away we go! 🐇✨

✨ 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 mxsm/core-services-unified-telemetry-bootstrap

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.

@rocketmq-rust-bot

Copy link
Copy Markdown
Collaborator

🔊@mxsm 🚀Thanks for your contribution🎉!

💡CodeRabbit(AI) will review your code first🔥!

Note

🚨The code review suggestions from CodeRabbit are to be used as a reference only, and the PR submitter can decide whether to make changes based on their own judgment. Ultimately, the project management personnel will conduct the final code review💥.

@rocketmq-rust-bot rocketmq-rust-bot added AI review first Ai review pr first auto merge ready to review waiting-review waiting review this PR approved PR has approved and removed ready to review waiting-review waiting review this PR labels Jul 6, 2026
@rocketmq-rust-robot rocketmq-rust-robot added the refactor♻️ refactor code label Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI review first Ai review pr first approved PR has approved auto merge refactor♻️ refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor♻️] Route core service entries through unified telemetry bootstrap

3 participants