-
Notifications
You must be signed in to change notification settings - Fork 295
Description
C# API for https://github.com/Microsoft/ApplicationInsights-Home/issues/232
New field flags on envelope will be used to set transport level characteristics for events. First one will be an ability to instruct endpoint to drop IP address.
We are working on feature to enable collection of full IP addresses. There will be a setting to opt-out from this behavior for entire Application Insights resource. Flags will enable to hide IP address for a single event. This way one can configure per-tenant or per-feature IP address collection to satisfy privacy requirements for a given app better.
Proposed API
Set flags for individual item. Typically for events that should not contain any PII. Typical example will be to set it based on user setting. If user accepted collecting her IP address - this flag is not set. Otherwise - set the flag.
EventTelemetry t = new EventTelemetry("Secret message") { Flags = TelemetryContext.FlagDropIdentifiers };
client.TrackEvent(t);Set flags for client. Typical use is to set flags on all events produced by specific client.
var client = new TelemetryClient();
client.Context.Flags |= TelemetryContext.FlagDropIdentifiers;
client.TrackEvent("secret message");