NClient icon indicating copy to clipboard operation
NClient copied to clipboard

Using Activity for requests

Open smolchanovsky opened this issue 2 years ago • 2 comments

This allows to collect more telemetry about the request for monitoring and investigation of problems. This will be helpful for usage of NClient, as well as for the development and debugging of the library.

Considering two user cases, I suggest making two types of activities: public and internal.

  1. One public activity is enough. It will show the execution time of the client's method. It is important to measure the execution of the interface method, not just interceptor. This can probably be done with ProcessingAsyncInterceptor<TState>, which should be used here.
  2. Ideally, each type of provider should have its own activity, but this is not required yet, so I suggest adding only one. It will measure the execution time of the transport request that occurs here.

Additional links:

  1. Basic information about Activity: https://docs.microsoft.com/en-us/dotnet/core/diagnostics/distributed-tracing-concepts
  2. Usage example: https://jimmybogard.com/activity-enrichment-in-asp-net-core-6-0/

smolchanovsky avatar Aug 16 '22 15:08 smolchanovsky

@smolchanovsky Happy to work on this issue if help is still needed!

parthvnp avatar May 08 '23 05:05 parthvnp

Hi @parthvnp ! It will be very cool if you do it =) Assigned the issue to you

smolchanovsky avatar May 13 '23 09:05 smolchanovsky