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
Add an ability to skip all arguments in the instrument macro.
Motivation
Currently, instrument requires explicit opt-out to avoid capturing arguments in a span. For some use cases, like those where arguments might contain sensitive data (e.g. passwords) that authors don't want to leak into logs, an opt-out model presents a risk where authors need to be diligent to include every sensitive argument in the opt-out list. A more manageable option would be to suppress all arguments and allow explicit opt-in for insensitive arguments.
Proposal
Add another option such as skip-all-except (or a more suitable name), which can take as its nested fields the arguments that the span should capture. When both skip and skip-all-except are present, the compiler could error.
Alternatives
An alternative would be to add a feature flag that sets the default behavior of the instrument macro to be to suppress all, but then there'd still need to be an option to opt into arguments to unsuppress.
The text was updated successfully, but these errors were encountered:
The plan is that in tracing-attributes v0.2, fields in instrument will be opt-in rather than opt-out. Since #672 added support for arbitrary expressions as fields to instrument, you will be able to specify what fields you want to include using the same syntax as the span! and event! macros (including local variable shorthand). This should make skipping fields unnecessary.
Feature Request
Add an ability to skip all arguments in the instrument macro.
Motivation
Currently, instrument requires explicit opt-out to avoid capturing arguments in a span. For some use cases, like those where arguments might contain sensitive data (e.g. passwords) that authors don't want to leak into logs, an opt-out model presents a risk where authors need to be diligent to include every sensitive argument in the opt-out list. A more manageable option would be to suppress all arguments and allow explicit opt-in for insensitive arguments.
Proposal
Add another option such as
skip-all-except
(or a more suitable name), which can take as its nested fields the arguments that the span should capture. When bothskip
andskip-all-except
are present, the compiler could error.Alternatives
An alternative would be to add a feature flag that sets the default behavior of the instrument macro to be to suppress all, but then there'd still need to be an option to opt into arguments to unsuppress.
The text was updated successfully, but these errors were encountered: