public static interface TraceContext.Injector<C>
For example, to put the context on an HttpURLConnection
, you can do this:
// in your constructor
injector = tracing.propagation().injector(URLConnection::setRequestProperty);
// later in your code, reuse the function you created above to add trace headers
HttpURLConnection connection = (HttpURLConnection) new URL("http://myserver").openConnection();
injector.inject(span.context(), connection);
Modifier and Type | Method | Description |
---|---|---|
void |
inject(TraceContext traceContext,
C carrier) |
Usually calls a setter for each propagation field to send downstream.
|
void inject(TraceContext traceContext, C carrier)
traceContext
- possibly unsampled.carrier
- holds propagation fields. For example, an outgoing message or http request.Copyright © 2017 OpenZipkin. All rights reserved.