Skip to content

Feature valuable#1256

Open
Vrajs16 wants to merge 6 commits intoserde-rs:masterfrom
Vrajs16:feature-valuable
Open

Feature valuable#1256
Vrajs16 wants to merge 6 commits intoserde-rs:masterfrom
Vrajs16:feature-valuable

Conversation

@Vrajs16
Copy link

@Vrajs16 Vrajs16 commented Apr 26, 2025

Adds support for valuable crate as feature flag

closes #1255

@Vrajs16
Copy link
Author

Vrajs16 commented May 7, 2025

Not sure how to pass the rust 1.56.1 check, if someone could help with that

@gnosek
Copy link

gnosek commented Jun 23, 2025

Not sure how to pass the rust 1.56.1 check, if someone could help with that

One way to do this is to use a different feature name so that it doesn't conflict with the crate name.

@Vrajs16
Copy link
Author

Vrajs16 commented Jun 23, 2025

Any suggestions?

@rollo-b2c2
Copy link

Any progress on this?

Would be really useful, right now I'm just copying this wholesale into my source tree (with new types)

@michaeltlombardi
Copy link

If there's any remaining work or concerns for this PR, I would be happy to tackle it. A project I'm currently working on has a need for consuming arbitrary trace data from external programs and we're already using JSON Lines for emitting messages that our program can bubble up. Unfortunately, because we can't implement Valuable on serde_json::Value ourselves, we would need to use the newtype pattern to wrap the incoming data (and also unwrap it if we add support for more known structured data fields so we can validate them correctly).

I previously offered to adopt the implementation in the valuable crate (see PR: tokio-rs/valuable#61) but haven't heard back from the maintainers. I don't have very strong opinions about whether this should be implemented in tracing or this crate, but I do think that there's strong value in one of the libraries closing this work out to enabling structured tracing given the ubiquity of JSON both as a common interchange format and as a specific export format for trace messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Implement valuable::Valuable on serde_json::Value as a feature flag

4 participants