【问题标题】:Application Insights through proxy通过代理的 Application Insights
【发布时间】:2017-12-04 13:14:55
【问题描述】:

我需要通过代理实现ApplicationApplication。

      var config = new TelemetryConfiguration
      {
        InstrumentationKey = "key",
        TelemetryChannel = new Microsoft.ApplicationInsights.Channel.InMemoryChannel()
      };
      var client = new TelemetryClient(config);

我的电脑上有一个 WPF 应用程序(启用了防火墙)与某个服务器通信,我只需要代理所有 AppInsights 请求,其余的不需要。

我可以在每次 AppInsights 请求时设置一个代理并最终清理它,但与服务器的通信会不断进行,并且在 AppInsigns 请求时可能会发生“正常”请求,这不需要代理.

WebRequest.DefaultWebProxy = new WebProxy("myproxy"); //so does not fit (that's bs)
_telemetry.TrackEvent(key, properties, metrics);
Flush();
WebRequest.DefaultWebProxy = WebRequest.GetSystemWebProxy();

我该如何解决这种情况?提前谢谢你。

【问题讨论】:

    标签: c# .net proxy


    【解决方案1】:

    解决方案

              var config = new TelemetryConfiguration
              {
                InstrumentationKey = "key",
                TelemetryChannel = new Microsoft.ApplicationInsights.Channel.InMemoryChannel()
              };
              config.TelemetryChannel.EndpointAddress = "https://myproxy.proxy";
              var client = new TelemetryClient(config);
    

    并且您的代理必须将流量重定向到https://dc.services.visualstudio.com:443/v2/track

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-16
      • 2020-02-25
      • 1970-01-01
      • 2021-08-02
      相关资源
      最近更新 更多