Skip to content

fix: shut down tracer provider on CLI exit - #1205

Open
Liona-orph wants to merge 1 commit into
txpipe:mainfrom
Liona-orph:fix/893-shutdown-tracer-provider
Open

fix: shut down tracer provider on CLI exit#1205
Liona-orph wants to merge 1 commit into
txpipe:mainfrom
Liona-orph:fix/893-shutdown-tracer-provider

Conversation

@Liona-orph

@Liona-orph Liona-orph commented Aug 13, 2026

Copy link
Copy Markdown

Summary

  • retain the configured OpenTelemetry tracer provider for the process lifetime
  • flush and shut it down after every CLI command, including error exits

Closes #893.

Validation

  • cargo check -p dolos --bin dolos
  • cargo test -p dolos --bin dolos (26 passed, 1 ignored)
  • cargo fmt --all -- --check
  • git diff --check

Summary by CodeRabbit

  • Bug Fixes
    • Improved application shutdown by properly closing telemetry after command execution.
    • Added error reporting when telemetry shutdown encounters a problem.
    • Ensured command results are preserved and returned after shutdown completes.

@Liona-orph
Liona-orph requested a review from scarmuega as a code owner August 13, 2026 09:44
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0b6119ac-7116-402f-ad89-df8a7483b92b

📥 Commits

Reviewing files that changed from the base of the PR and between 957cb38 and cce5b66.

📒 Files selected for processing (2)
  • src/bin/dolos/common.rs
  • src/bin/dolos/main.rs

📝 Walkthrough

Walkthrough

The change retains the OpenTelemetry SDK tracer provider and adds explicit tracing shutdown after command execution. Shutdown errors are reported to stderr while preserving the command result.

Changes

Tracing lifecycle

Layer / File(s) Summary
Retain the tracer provider
src/bin/dolos/common.rs
setup_tracing stores the provider after global registration.
Shutdown tracing after dispatch
src/bin/dolos/common.rs, src/bin/dolos/main.rs
main stores the command result, calls shutdown_tracing, and returns the stored result. Shutdown errors are printed to stderr.

Estimated code review effort: 2 (Simple) | ~10 minutes

Mergeability Score: 🟡 Moderate · up to cce5b

The CLI now flushes and shuts down tracing after each command, including error exits, but the required workspace-wide clippy, build, and test checks are not listed as completed, so merge readiness remains moderate until those checks pass.

Suggested reviewers: scarmuega

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes shutting down the tracer provider when the CLI exits.
Linked Issues check ✅ Passed The changes retain the tracer provider and shut it down after command execution, including error results, which addresses issue #893.
Out of Scope Changes check ✅ Passed All changes directly support tracer provider shutdown during CLI teardown and remain within issue #893 scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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.

Missing tracer provider shutdown — spans may be lost on exit.

1 participant