Tracers/Tracer.cs
/// <summary>
/// Use this tracer when you want to trace a remote resource (like a web api) wich is not running Zipzin
/// and will not be able to resume tracing.
/// </summary>
Use this tracer when you want to trace a remote resource (like a web api) wich is not running Zipzin
and will not be able to resume tracing.
Use this tracer when you want to trace a remote resource ( like a web api ) wich is not running Zipzin and will not be able to resume tracing .
public static T TraceUnmanagedHttpRequest<T>(HttpRequestMessage request, string remoteServiceName, Func<T> function)
        {
            var tracer = new UnmanagedHttpRequestTracer();
            try
            {
                tracer.BeginTrace(request, remoteServiceName);
                return function.Invoke();
            }
            catch (Exception exception)
            {
                TracerContext.AddTag("Exception", exception.Message);
                TracerContext.AddTag("StackTrace", exception.StackTrace);
            }
            finally
            {
                tracer.EndTrace();
            }
            return default;
        }
public static T TraceUnmanagedHttpRequest < T > ( HttpRequestMessage request , string remoteServiceName , Func < T > function ) { var tracer = new UnmanagedHttpRequestTracer ( ) ; try { tracer . BeginTrace ( request , remoteServiceName ) ; return function . Invoke ( ) ; } catch ( Exception exception ) { TracerContext . AddTag ( " " , exception . Message ) ; TracerContext . AddTag ( " " , exception . StackTrace ) ; } finally { tracer . EndTrace ( ) ; } return default ; }
Use this tracer when you want to trace a remote resource (like a web api) wich is not running Zipzin
and will not be able to resume tracing.
Use this tracer when you want to trace a remote resource ( like a web api ) wich is not running Zipzin and will not be able to resume tracing .
request
HttpRequestMessage
remoteServiceName
string
function
Func<T>