-
Notifications
You must be signed in to change notification settings - Fork 892
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
Add possibility to disable db.statement
#1659
Add possibility to disable db.statement
#1659
Conversation
db.statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not clear what mechanism is supposed to be used for disabling this attribute. Either we need to (1) expose a common API that instrumentation can query to decide whether to provide db.statement attribute to the span or not (a bad option imo), or (2) there can be a configuration for the exporter to strip out db.statement from the spans (a reasonable approach, but not super efficient), or (3) the best option, I think, is to have the instrumentation itself be configurable to include / not include db.statement.
@yurishkuro Great idea 👍 I tried to capture it here: 656cee2 |
Should parsing the SQL to provide at least something like |
I feel that such recommendation could give more harm than benefits. SRE / DBA can always use additional database specific profilers or other DB monitoring tools to analyze DB specific issues. |
I agree that parsing has disadvantages. But I wonder how useful a span without db.statement and db.operation usually is. |
A lot. Still can be used to e.g. identify if DB is a bottleneck for some service's endpoint/operation/method. IMO duration is the most valuable and critical info here |
Maybe totally unrelated, but duration can/should be reported as metric. |
Why
db.statement
can expose a lot of sensitive informationCurrently
db.statement
is specified to be required if applicable.Unfortunately, the SQL
db.statement
(and others database types most probably as well) are often not properly parametrized and therefore leak data that is inside the databases. Even all examples in the spec are "leaking" some data. Additionally it is not easy to introduce parameterized queries to the legacy systems or it will take a very long time to fix the queries (sometimes it may be even a problem with some data access library). At last, not everything in the query can be parametrized (e.g. table names for MS SQL Server).What
Mention in the specs that it should be possible to disable adding the
db.statement
attribute via instrumentation configuration (thanks @yurishkuro).This change is backward compatible.