Skip to content

Commit

Permalink
Use force capture in json panic handler
Browse files Browse the repository at this point in the history
Signed-off-by: Danil <deniallugo@gmail.com>
  • Loading branch information
Deniallugo committed Apr 4, 2024
1 parent 2478fe0 commit ebfd4ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/lib/config/src/configs/observability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct ObservabilityConfig {
/// Currently must be either `plain` or `json`.
pub log_format: String,
pub sporadic_crypto_errors_substrs: Vec<String>,
// Log directives in format that is used in RUST_LOG
// Log directives in format that is used in `RUST_LOG`
pub log_directives: Option<String>,
}

Expand Down
4 changes: 1 addition & 3 deletions core/lib/vlog/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,16 +312,14 @@ impl ObservabilityBuilder {
None
};

// We use backtrace capture in `json_panic_handler` so we have to have it always enabled
std::env::set_var("RUST_BACKTRACE", "1");
ObservabilityGuard {
_sentry_guard: sentry_guard,
}
}
}

fn json_panic_handler(panic_info: &PanicInfo) {
let backtrace = Backtrace::capture();
let backtrace = Backtrace::force_capture();
let timestamp = chrono::Utc::now();
let panic_message = if let Some(s) = panic_info.payload().downcast_ref::<String>() {
s.as_str()
Expand Down

0 comments on commit ebfd4ce

Please sign in to comment.