简体   繁体   English

如何在Application Insights中隐藏客户端IP地址?

[英]How can I hide Client IP address in Application Insights?

I've tried to add the following TelemetryInitializer: 我尝试添加以下TelemetryInitializer:

TelemetryConfiguration.Active.TelemetryInitializers.Add(new HiddenIpsTelemetryInitializer());

public class HiddenIpsTelemetryInitializer : ITelemetryInitializer
{
    public void Initialize(ITelemetry telemetry)
    {
        telemetry.Context.Properties["Client IP address"] = "Hidden";
    }
}

But it doesn't do what I want. 但这不能满足我的要求。 It adds a new property to "Custom Data" section, and what I want is to hide the "Client IP address" in "Request Properties" section. 它向“自定义数据”部分添加了一个新属性,而我要隐藏“请求属性”部分中的“客户端IP地址”。

There was a service announcement recently on AI Service blog informing that IP will be zeroed out after AI has extracted Geo location information from it. AI服务博客上最近发布了一条服务公告 ,通知AI从其提取地理位置信息后IP将被清零。

This is done to make sure the privacy concerns of AI customers are addressed in light of upcoming GDPR law in EU . 这样做是为了确保根据欧盟即将颁布的GDPR法律解决AI客户的隐私问题。

So, you do not need to hide it anymore. 因此,您不再需要隐藏它。

you need to change the value of telemetry.Context.Ip instead of what you are doing. 您需要更改telemetry.Context.Ip的值,而不是正在执行的操作。 anything inside properties named like that would be submitting new custom properties. 属性名称之内的任何内容都将提交新的自定义属性。

to see how AI collects it in the core .net sdk, see: LocationContext.cs in the core sdk on github 若要查看AI如何在核心.net sdk中收集它,请参见: github上核心sdk中的LocationContext.cs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM