[英]Application Insights through proxy
我需要通过代理实现Application Application。
var config = new TelemetryConfiguration
{
InstrumentationKey = "key",
TelemetryChannel = new Microsoft.ApplicationInsights.Channel.InMemoryChannel()
};
var client = new TelemetryClient(config);
我的PC上有一个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();
我该如何解决这种情况? 先感谢您。
解
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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.