/opentracefasthttp

Opentracing carrier for fasthttp server. Gives possibility to use span extract/inject options

Primary LanguageGoApache License 2.0Apache-2.0

Build Status

opentracefasthttp

Opentracing carrier for fasthttp server. Gives possibility to use span extract/inject options

examples

client send with request's header

	req := fasthttp.AcquireRequest()
	...
	
	carrier := opentracefasthttp.New(&req.Header)
	err = opentracing.GlobalTracer().Inject(span.Context(), opentracing.HTTPHeaders, carrier)

server read from request's header

	func(ctx *fasthttp.RequestCtx) {
		carrier := opentracefasthttp.New(&ctx.Request.Header)
		clientContext, err := tr.Extract(opentracing.HTTPHeaders, carrier)
		if err != nil{
			...
		}
		span := trace.StartSpan("HTTP "+string(ctx.Method())+" "+ctx.Request.URI().String(), ext.RPCServerOption(clientContext))
	}