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
SQLDriverSegmentBuilder containing ParseArgs func #467
Comments
Or... If there was a way to access app config via context on ParseArgs, we could only expose args if some conf was previously set. |
Thanks for the suggestion! We're already considering an enhancement like this for reporting more details of SQL queries than what the agent already does. We'll make sure to consider these features, or something equivalent, in that update. |
Great news! Would you guys accept/want any help implementing that update? I would love to participate on it, if possible 😁 |
Hi @psimoesSsimoes if you wanted to take a shot at it and submit a PR, that would be greatly appreciated! We would be happy to provide support or feedback. |
@iamemilio i will do it. One question before i draft it: |
Good question! In my opinion, we should exclude them by default, since most customers will not know that new functionality has been added and expect the behavior which protects their data. |
@psimoesSsimoes any update on this? |
Summary
At the moment, datastore segments created by pre-built integration packages (for MySQL, PostgreSQL, or SQLite database drivers) never set
segments.QueryParameters
.Desired Behaviour
If
SQLDriverSegmentBuilder
contained anParseArgs
func field func thenExecContext
,QueryContext
, andQueryRowContext
implementations would call this func to set queryparameters.Since some query parameters might be sensitive, it should be optional for the client to use this ParseArgs when calling these implementations.
Possible Solution
we would add parse args to
SQLDriverSegmentBuilder
:On
QueryContext
, andExecContext
we would call it after segment creation.One example, using
wrapStmt.QueryContext
:We could support two parse args implementations:
NopParseArgs
would be the default value and it´s implementation would be a NOP.ParseArgs
implementation could be:Packages v3/integrations/nrmysql ,v3/integrations/nrpq and 3/integrations/nrsqlite3 by default would use the
NopParseArgs
.This is the part that is not clear to me: how could a client set baseBuilder ParseArgs if it needed?
Additional context
We don't get much information about the queries parameters which help to debug queries that are slow for some query parameters and not for others.
The text was updated successfully, but these errors were encountered: