Tracers/Tracer.cs
/// <summary>
/// Use this when you will use a remote resource (like a web api) running Zipkin and able to resume tracing.
/// </summary>
Use this when you will use a remote resource (like a web api) running Zipkin and able to resume tracing.
Use this when you will use a remote resource ( like a web api ) running Zipkin and able to resume tracing .
public static T TraceHttpRequest<T>(HttpRequestMessage request, Func<T> function)
        {
            var tracer = new HttpRequestTracer();
            try
            {
                tracer.BeginTrace(request);
                return function.Invoke();
            }
            catch (Exception exception)
            {
                TracerContext.AddTag("Exception", exception.Message);
                TracerContext.AddTag("StackTrace", exception.StackTrace);
            }
            finally
            {
                tracer.EndTrace();
            }
            return default;
        }
public static T TraceHttpRequest < T > ( HttpRequestMessage request , Func < T > function ) { var tracer = new HttpRequestTracer ( ) ; try { tracer . BeginTrace ( request ) ; return function . Invoke ( ) ; } catch ( Exception exception ) { TracerContext . AddTag ( " " , exception . Message ) ; TracerContext . AddTag ( " " , exception . StackTrace ) ; } finally { tracer . EndTrace ( ) ; } return default ; }
Use this when you will use a remote resource (like a web api) running Zipkin and able to resume tracing.
Use this when you will use a remote resource ( like a web api ) running Zipkin and able to resume tracing .
request
HttpRequestMessage
function
Func<T>