-
Notifications
You must be signed in to change notification settings - Fork 125
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
A way to scrub telemetry_ecto events of sensitive data #450
Comments
What happens if you set |
We already have |
You would normally want to scrub it with a processor: https://opentelemetry.io/docs/security/config-best-practices/#scrub-sensitive-data |
I see. I think there is value in scrubbing the data earlier like how I'm doing it because it allows me to scrub the |
And since it gets turned into a string you can't even do it with that processor. |
|
We recently noticed that ecto telemetry events emitted for postgres errors contains the full executed query including the actual values passed to queries or the actual values conflicting with constraints for example.
Here is a screenshot of an example:
This is a problem because we don't want to leak sensitive data such as personally identifying information to whatever system consumes these events.
Describe the solution you'd like
I think a builtin way to transform events, which allows library users to implement data scrubbing, would be a good addition to telemetry_ecto.
Our current workaround looks like this, we have our own module that attaches an event handler for repo events. The module has an event handler that forwards all events to
OpentelemetryEcto.handle_event
but scrubs errors of sensitive data.Ideally OpentelemetryEcto provides a way to specify a module or function that will be called for all handled events to transform them.
The most basic way to achieve this could be
OpentelemetryEcto.setup([:my_app, :repo], transform: fn _even -> ... end)
.Describe alternatives you've considered
The workaround above works fine, but I believe it's worth having a builtin and documented way of doing this.
What do you think? I'd be happy to contribute a MR.
The text was updated successfully, but these errors were encountered: