Skip to content

Instantly share code, notes, and snippets.

@skynyrd
Created January 23, 2019 04:59
Show Gist options
  • Save skynyrd/95a7181d0fd78f32ae35c036d9184500 to your computer and use it in GitHub Desktop.
Save skynyrd/95a7181d0fd78f32ae35c036d9184500 to your computer and use it in GitHub Desktop.
jaeger crossing the apis
// You need to add headers to your ITracer if you are going to call other APIs
var dictionary = new Dictionary<string, string>();
_tracer.Inject(scope.Span.Context, BuiltinFormats.HttpHeaders, new TextMapInjectAdapter(dictionary));
foreach (var entry in dictionary)
{
_httpClient.DefaultRequestHeaders.Add(entry.Key, entry.Value);
}
// Or you can use the wrapper
traceBuilder
...
.WithHttpCall(clientInstance, url, httpMethod)
.TraceIt(() =>
{
...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment