Created
January 23, 2019 04:59
-
-
Save skynyrd/95a7181d0fd78f32ae35c036d9184500 to your computer and use it in GitHub Desktop.
jaeger crossing the apis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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