Skip to content

feat(csharp): add PII redaction in tracing, by default#4027

Open
birschick-bq wants to merge 9 commits intoapache:mainfrom
birschick-bq:dev/birschick-bq/pii-tracing
Open

feat(csharp): add PII redaction in tracing, by default#4027
birschick-bq wants to merge 9 commits intoapache:mainfrom
birschick-bq:dev/birschick-bq/pii-tracing

Conversation

@birschick-bq
Copy link
Copy Markdown
Contributor

@birschick-bq birschick-bq commented Feb 27, 2026

Adds PII redaction in tracing, by default.

The new class ActivityWithPii wraps the System.Diagnostics.Activity object 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 TraceActivity overloads and extension method that are use Activity have been marked as Obsolete. They have been replaced with overloads using the new ActivityWithPii class.

As marking the TraceActivity overloads and extension methods as Obsolete causes the build to fail, I've update the drivers in two commits. The first commit uses #pragma to ignore the warnings. The second commit, implements the change to use the new ActivityWithPii class.

The FileExporter and FileListener have 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.

@birschick-bq
Copy link
Copy Markdown
Contributor Author

@CurtHagenlocher - let me know if you have some time to review this or if is a low priority for you. Thanks.

@davidhcoe
Copy link
Copy Markdown
Contributor

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.

@davidhcoe
Copy link
Copy Markdown
Contributor

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.

@birschick-bq
Copy link
Copy Markdown
Contributor Author

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 Obsolete attributes, now that I've found all references. Then add back the Obsolete attribute once the other files are deprecated driver files and removed.

@davidhcoe
Copy link
Copy Markdown
Contributor

Yes lets do that.

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

Successfully merging this pull request may close these issues.

2 participants