LukeMathWalker / LukeMathWalker/tracing-bunyan-formatter
Allow skipping required fields
- Dominant language
- Rust
- Stars
- 112
- Forks
- 44
- PR merge metrics
- No merged PRs in 30d
Description
Due to an implementation decision from datadog, hostname is interpreted as the host, but in containerized environments, this isn't necessarily accurate. Here is a more detailed description of the problem:
https://github.com/CrowdDotDev/crowd.dev/pull/2143
It seems like the solution in this context is to just not log `hostname`. I see that when the skip fields feature was added, there was an explicit desire to return an Err if one of the skipped fields is required according to the spec:
https://github.com/LukeMathWalker/tracing-bunyan-formatter/pull/25#discussion_r1060960626
I appreciate the desire to adhere to the bunyan format and prevent deviation, but I'd also hate to throw the baby out with the bathwater. One option would be to relax that constraint and not return an Err. Another option would be to create explicit skip method for each of the required fields, and change those fields on the `BunyanFormattingLayer` to `Option`s:
```rs
pub fn skip_hostname(mut self) -> Self
```
I'm happy to create a PR for whatever path you think would be best for this project.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the existing skip-fields implementation and the referenced Datadog report and tracing-bunyan-formatter discussion. Decide which proposed behavior the project will adopt for required fields, then add coverage showing that the selected required field can be skipped without an unexpected error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100