Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
CtxTraceId = "trace_id"
)
Functions ¶
func Tracer ¶
func Tracer(collector *tracePkg.Collector) usrv.EndpointOption
The tracer middleware emits TraceEntry objects to the supplied Collector whenever the server processes an incoming request.
Two Trace entries will be emitted for each request, one for the incoming request and one for the outgoing response.
The middleware will inject a traceId for each incoming request into the context that gets passed to the request handler. To ensure that any further RPC requests that occur inside the wrapped handler are associated with the current request, the handler should pass its context to any performed RPC client requests.
This function is designed to emit events in non-blocking mode. If the Collector does not have enough capacity to store a generated TraceEntry then it will be silently dropped.
Types ¶
This section is empty.