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

otelgorm feature: pick which query variables are emitted #65

Open
igrayson opened this issue Jul 20, 2022 · 1 comment
Open

otelgorm feature: pick which query variables are emitted #65

igrayson opened this issue Jul 20, 2022 · 1 comment

Comments

@igrayson
Copy link
Contributor

igrayson commented Jul 20, 2022

otelgorm has the WithoutQueryVariables() option to keep the emitted statement unparameterized. I would like to emit statements that are partially parameterized. My use-case is: my service occasionally handles information which I do not want logged. On the other hand, it's really useful being able to see which IDs a database statement actually hit.

One way to satisfy this is providing something like:

func WithQueryVariableFilter(predicate func(var interface{}) bool) Option

.. and I could provide a filter that only allows uuid strings (etc)

Thoughts? I'd be happy to open a PR.

@vmihailenco
Copy link
Member

Sounds like a good idea 👍 Let's see how the code looks like.

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

2 participants