microsoft / ApplicationInsights-ServiceFabric

ApplicationInsights SDK for ServiceFabric projects
MIT License
63 stars 26 forks source link

Expose Request\Response events #106

Closed festivus closed 4 years ago

festivus commented 4 years ago

I would like to use ServiceRemotingServiceEvents.SendResponse to do global exception handling\logging. The problem is there is no way to say I want my SendResponse to be called before yours, so sometimes the exception is logged after the app insights operation is finished in your SendResponse, so my exception is not correlated to any of the messages in the chain. Could you expose events before closing the operation?

yantang-msft commented 4 years ago

@festivus So we register our event handler at here, which is triggered in initializing the ServiceRemotingRequestTrackingTelemetryModule. Can you try to register your SendReponse event handler before initializing ServiceRemotingRequestTrackingTelemetryModule?