You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thread 'main' panicked at 'span 'test' had malformed fields! this is a bug.
error: expected value at line 1 column 1
fields: FormattedFields { fields: "input=\"hai\"", formatter: tracing_subscriber::fmt::format::DefaultFields }', ~/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.3.0/src/fmt/format/json.rs:166:49
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
If we comment the #[tracing::instrument] line, it works as expected.
The text was updated successfully, but these errors were encountered:
Sorry for the delay and the fact that you encountered this issue. The issue is the same as #1365; you'll also need add a JSON-specific field formatter, which is needed to record span fields (in reproduction, that would be input).
No worries, thanks for taking your time into this. Eventually, I stumbled on the json example in the repository and found out that I should use tracing_subscriber::fmt().json() directly. Not sure why I was using it the other way previously, perhaps there is some tutorial somewhere that's misleading.
Bug Report
Version
Platform
Linux 5.10.84-1-lts #1 SMP Wed, 08 Dec 2021 10:17:01 +0000 x86_64 GNU/Linux
Crates
tracing-subscriber
Description
When using the JSON format in conjunction with the
#[instrument]
macro, we get a panic.Minimal code:
Which results in:
If we comment the
#[tracing::instrument]
line, it works as expected.The text was updated successfully, but these errors were encountered: