Closed ldellisola closed 1 year ago
Would another option be a max length?
That would work for my specific case, but I think this is a better general approach.
For example, you probably shouldn't be logging all the data inserted into your database as it may have PII such as Full names, addresses, SSN, etc. This modification gives the users of the library more options on which statements will be recorded.
Is there a reason for implementing InstrumentationOptions.MaxLenght
over InstrumentationOptions.ShouldCaptureCommandText
?
I think a better option here might be an activity processor. You can inspect and modify the tag values there. I checked a few other APIs and there aren't really similar kinds of extension points (SQL, HttpClient, etc.). It's an interesting idea but there's already an option to modify arbitrary tag values.
I found myself having huge
insert
db statements (~3/4 million characters long) in our projects. Those traces were eating up all the storage in our servers and it slowed down tools like Grafana or Jaeger.I would like to still have the trace data, but to not generate the
db.statement
tag in these cases. For other operations, their size is relatively small and therefore I want to include thedb.statement
tag.The new
InstrumentationOptions.ShouldCaptureCommandText
option allows for this and it can be overridden by theInstrumentationOptions.CaptureCommandText
to maintain compatibility.