Skip to content

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

Open
birschick-bq wants to merge 8 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 8 commits intoapache:mainfrom
birschick-bq:dev/birschick-bq/pii-tracing

Conversation

@birschick-bq
Copy link
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
Contributor Author

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

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.

1 participant