feat(csharp): add PII redaction in tracing, by default#4027
feat(csharp): add PII redaction in tracing, by default#4027birschick-bq wants to merge 16 commits intoapache:mainfrom
Conversation
…text for trace activity
|
@CurtHagenlocher - let me know if you have some time to review this or if is a low priority for you. Thanks. |
|
I think we can remove the changes that are under the Drivers folder since those are on the deprecation path. The changes are only needed in the new Foundry repo. |
I see. You mention in the description the build was breaking without that. |
I could remove the |
|
Yes lets do that. |
@davidhcoe - compromise, I had bracketed the obsolete method calls with |
|
I would prefer to not have any changes in the Drivers folder. This will update the dates of all of the files and gives the illusion they are still under active development. |
|
|
Let me know if you have some time to review this PR. |
I'm sorry for having taken so long to get to this, but I knew I'd need to be able to spend some time understanding the bigger picture. If I understand the goal of this change correctly, it's that it would let unredacted traces in a service environment be written to the file system on-demand for individual troubleshooting purposes, while using The main concern I have with the approach in the PR is that it only works for drivers implemented in .NET that haven't been AOT-compiled and are running in same CLR instance as the The other thing which feels a little unsettling is that it basically projects elements of our own internal privacy model onto the shared specification for (.NET-based) ADBC drivers, and in a way that limits the ability to (for instance) use an OTel-compatible exporter to get data that we consider sensitive but which another consumer might not. Unfortunately, the Open Telemetry guidance around "sensitive values" seems to be to "don't log them at all", which isn't very helpful in an environment where the regulatory landscape varies so much between jurisdictions and over time. The only other approach that immediately comes to mind is to encode the semantics of the value in its key name, but I'm still thinking about this. |
Adds PII redaction in tracing, by default.
The new class
ActivityWithPiiwraps theSystem.Diagnostics.Activityobject and replicates its interface. By default, the methods assume that tag values passed to the methods contain PII, unless explicitly marked otherwise (i.e.,isPii = false).The previous
TraceActivityoverloads and extension method that are useActivityhave been marked asObsolete. They have been replaced with overloads using the newActivityWithPiiclass.As marking the
TraceActivityoverloads and extension methods asObsoletecauses the build to fail, I've update the drivers in two commits. The first commit uses#pragmato ignore the warnings. The second commit, implements the change to use the newActivityWithPiiclass.The
FileExporterandFileListenerhave been updated to reveal the original that have been redacted - with the assumption that writing to the local file system is controlled by an authorized user.