Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow skipping required fields #41

Open
bbstilson opened this issue Sep 19, 2024 · 0 comments
Open

Allow skipping required fields #41

bbstilson opened this issue Sep 19, 2024 · 0 comments

Comments

@bbstilson
Copy link

bbstilson commented Sep 19, 2024

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:

CrowdDotDev/crowd.dev#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:

#25 (comment)

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 Options:

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.

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

No branches or pull requests

1 participant