implement a way to filter fields by name on log json formatter#2353
implement a way to filter fields by name on log json formatter#2353bnjjj wants to merge 1 commit intotokio-rs:masterfrom
Conversation
|
hi! i'm sorry for the delay in reviewing this. here's some general feedback:
|
|
You may want to look at issue #73, which proposes a more general solution like what @davidbarsky's describing in #2353 (comment). |
|
Thanks ! I will take a look and update the code :) |
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
72c51b7 to
500276f
Compare
|
Ok @hawkw and @davidbarsky thanks for your feedback. I already wrote a small |
|
Regarding my message on discord here do you have an idea on how I could properly implement it for json format @davidbarsky and @hawkw ? THanks a lot |
|
The link to the discord discussion is no longer working. Is there still interest in implementing this feature? Could I try to help with that? |
This is a WIP PR to have your feedback
Motivation
I recently needed to filter fields from json logs, especially because sometimes for some logics in our own exporters we put some specific fields on spans and logs. But these fields are only useful for logic stuffs, they doesn't add any useful information for the users. So I looked over your documentation but was only able to find a way to filer the entire event based on fields and not filter fields from an event (log).
Solution
Implement the method
filter_fields_by_namemethod for json formatter.Example: