WCF service operation name

懵懂的女人 提交于 2019-12-10 16:35:54

问题


Is there a way to configure App Insights to collect the operation name when monitoring a WCF service? All requests get lumped together by URL (which are just POSTs that end in .svc), so there is no easy way to determine which particular operation was called on the service.

Does there need to be a custom Telemetry Initializer that can somehow determine which operation was actually called and set a custom property? if so, how do you determine the current WCF operation name?


回答1:


Brett,

Operation name can be customized in two ways:

1) Using a custom telemetry initializer - that specifically sets operation name. For more information about telemetry initializers: Custom Telemetry Initializers

2) From sdk version 2-beta3, auto-generated request telemetry is accessible though HttpContext extension method:

System.Web.HttpContextExtension.GetRequestTelemetry

Once the request telemetry is retrieved, operation name associated with it can be changed.

Please let me know if this addressed your question.

Thanks, Karthik




回答2:


Another option for collecting data on WCF operations is to use the Microsoft.ApplicationInsights.Wcf Nuget package. You can read more about this here.



来源:https://stackoverflow.com/questions/34482869/wcf-service-operation-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!