blob: 555032d796d16557b7b2eabab3c8bab361e64a8c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
.. _brave_backend:
brave backend
=============
To use, add the following dependency to your project::
"com.softwaremill.sttp" %% "brave-backend" % "1.1.13"
This backend depends on `brave <https://github.com/openzipkin/brave>`_, a distributed tracing implementation compatible with Zipkin backend services.
The brave backend wraps any other backend, and needs an instance of brave's ``HttpTracing`` or ``Tracing``, for example::
val httpTracing: HttpTracing = ...
implicit val sttpBackend = BraveBackend(AkkaHttpBackend(), httpTracing)
The backend obtains the current trace context using default Brave's propagation mechanisms. As it's often challenging to integrate context propagation in an asynchronous setting, there's also a possibility to add the trace context to the request's tags::
import com.softwaremill.sttp.brave.BraveBackend._
val parent: TraceContext = ...
sttp
.get(...)
.tagWithTraceContext(parent))
|