EventProvider ActivityId in a call context using AppFabric

十年热恋 提交于 2019-12-11 11:12:44

问题


I am using the EventProvider to write events that eventually get written to Appfabric. It generally follows the EventProvider implementation as specified here.

I am using this from with in a WCF service. The service calls other methods asynchronously, so the logic of service operates on multiple threads. As I understand the E2EActivityId of events use Trace.CorrelationManager.ActivityId which is stored in Thread's TLS. I tried setting the EventProvider.SetActivityId(ref ..) method before making the call to write event, but that did not work.

So I am not able to group all the events from a single WCF operation context.

Is there any way to group calls?


回答1:


I had the same issue. I solved it by adding a probably new attribute named activityTracing="true" to the element endToEndTracing. I'm using AppFabric 1.1 on a Windows Server 2012, .net 4.5.

To make a long story short I post my config here

     <!-- AppFabric Config -->
  <system.serviceModel>
    <diagnostics etwProviderId="830b12d1-bb5b-4887-aa3f-ab508fd4c8ba">
      <endToEndTracing propagateActivity="true" activityTracing="true" messageFlowTracing="true" />
    </diagnostics>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <etwTracking profileName="EndToEndMonitoring Tracking Profile" />
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
  <microsoft.applicationServer>
    <monitoring>
      <default enabled="true" connectionStringName="ApplicationServerMonitoringConnectionString" monitoringLevel="EndToEndMonitoring" />
    </monitoring>
  </microsoft.applicationServer>


来源:https://stackoverflow.com/questions/9848552/eventprovider-activityid-in-a-call-context-using-appfabric

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