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
Our team has been playing around with redact and something we're trying to wrap our heads around is how to determine if redact has modified the input. This is straightforward when the input is a string, but we're not sure what to do with objects. We've tried abusing assert_eq but the docs recommend against using assertions outside of unit tests.
An "easy" way around this problem would be if redact could return two values:
The <string | object | array> output as usual
A <boolean> indicating whether or not the output has changed
The workaround I can see for now is something along the lines of
My hesitation is that I'm not sure how expensive it is to marshal JSON twice on every log event, especially as we're operating at a decently large scale. On the other hand, Vector has made me into a Rust true believer, and maybe I'm over-thinking the performance implications.
The text was updated successfully, but these errors were encountered:
Our team has been playing around with
redact
and something we're trying to wrap our heads around is how to determine ifredact
has modified the input. This is straightforward when the input is a string, but we're not sure what to do with objects. We've tried abusingassert_eq
but the docs recommend against using assertions outside of unit tests.An "easy" way around this problem would be if
redact
could return two values:<string | object | array>
output as usual<boolean>
indicating whether or not the output has changedThe workaround I can see for now is something along the lines of
My hesitation is that I'm not sure how expensive it is to marshal JSON twice on every log event, especially as we're operating at a decently large scale. On the other hand, Vector has made me into a Rust true believer, and maybe I'm over-thinking the performance implications.
The text was updated successfully, but these errors were encountered: