none
WCF with Appfabric custom event gets a new ActivityId. RRS feed

  • Question

  • I have a WCF service that is configured to run in IIS with AppFabric enabled.

    When I make a request I can see that the events are showing up in AppFabric.

    If I add an IDispatchMessageInspector as a endpoint behaviour and write to the appfabric log via the help class "WCFUserEventProvider" I see that the entry is added to AppFabric but it's not correlated to the initial request. The downside is that I cannot find the custom-log entry via the AppFabric GUI by right clicking on the initial request entry -> View All Related Events.

    Why is the ActivityId changed and why isn't the custom-entry related to the initial AppFabric request?

    In the web.config I've enabled:

    <diagnostics etwProviderId="edbfb34f-9947-4fe3-bc21-4d4759bc0d33">
          <endToEndTracing propagateActivity="true" messageFlowTracing="true" />
        </diagnostics>

    Wednesday, December 14, 2016 9:35 AM

All replies

  • Hi Alverdal,

    Could you share us a complete project which could reproduce your issue through OneDrive? I configured AppFabric in IIS, and make a test with simple WCF Service, I could not view all Related Events.

    It would be helpful if you could share us detailed steps to reproduce your issue.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, December 15, 2016 6:41 AM
  • Hi Edward,

    So you couldn't either see the related events in AppFabric? So you have reproduced the error?

    Did you set the AppFabric monitoring-level to "End-To-End monitoring"?

    The only way I can find my custom events is when I open AppFabric GUI -> Services -> Mark the service -> View tracked events.

    It seem a bit strange that the custom logging isn't "correlated" to the initial request.

    I can share the project but it will take a little while to setup, I'll post again when it's available.

    Best regards, Johan

    Thursday, December 15, 2016 9:15 AM
  • Hi Alverdal,

    It seems I could reproduce your issue, I will get different E2EActivitys. It seems I am not able to set the ActivityId for custom event with the same ActivityId in Appfabric. ActivityId is coming from request, if you add this watch “((System.Runtime.Diagnostics.EventTraceActivity)E2EActivity).ActivityId.ToString()” for below code, you will get the ActivityId for this request.

                MessageProperties request = OperationContext.Current.IncomingMessageProperties;
                var E2EActivity = request["E2EActivity"];

    But, I am not able to get ActivityId in code.

    For a workaround to view all Related Events, I suggest you set activityTracing="true", something like below:

        <diagnostics etwProviderId="edbfb34f-9947-4fe3-bc21-4d4759bc0d33">
          <endToEndTracing propagateActivity="true" messageFlowTracing="true" activityTracing="true"/>
        </diagnostics>

    With above configuration, you will view all Related Events while you mark the operation request->View all Related Events even though the ActivityIds are different.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 16, 2016 10:38 AM
  • Hi,

    When I enabled activityTracing="true" I could find the related events.

    But I still miss one of my events which I create in a IDispatchMessageInspector.AfterReceiveRequest.

    However I can find the IDispatchMessageInspector.BeforeSendReply message in the related events in AppFabric.

    Here is an example project I've created: https://dl.dropboxusercontent.com/u/19234950/MsdnExample/MsdnWcfAppFabricService.zip

    Here is an image that shows which events that was logged in AppFabric and shows that the AfterReceiveRequest is missing, but the BeforeSendReply is logged correct: https://dl.dropboxusercontent.com/u/19234950/MsdnExample/2016-12-19_1451.png

    Br, Johan

    Monday, December 19, 2016 1:55 PM
  • Hi Johan,

    Thanks for more information. I made a test with your project and I could reproduce your issue. I failed to make it work under AfterReceiveRequest.

    I'm trying to involve some senior engineers into this issue and it will take some time. Your patience will be greatly appreciated. 

    Sorry for any inconvenience and have a nice day!

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, December 20, 2016 6:53 AM
  • Hi Edward,

    Have you been able to find anything regarding why we the E2EActivities don't correlate?

    br, Johan

    Thursday, February 9, 2017 3:55 PM
  • Hi Johan,

    It is sad I did not receive any response from senior engineers, I assume it is a difficult issue to resolve, I will confirm with senior engineers again.

    If there is any update, I would come back as soon as possible.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 10, 2017 5:56 AM
  • Dear forum user,

    Your question falls into a category which requires a more in-depth level of support.  Please visit the below link to see the various free and paid support options that are available to better meet your needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    Following is some links for your reference:

    http://stackoverflow.com/questions/24213782/how-to-use-idispatchmessageinspector-in-a-wcf-service

    http://www.thejoyofcode.com/Propagating_the_ActivityId_to_a_WCF_service.aspx

    http://stackoverflow.com/questions/8101623/using-idispatchmessageinspector-to-get-requests-remote-address


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Tuesday, February 21, 2017 9:42 AM