Documentation ¶
Index ¶
- Constants
- func ExposeHandler(h http.Handler) http.Handler
- func ExposeInterceptor() grpc.UnaryServerInterceptor
- func ExtractTraceID(ctx context.Context) string
- func HTTPMiddleware(handler http.Handler, tracer opentracing.Tracer) http.Handler
- func Interceptor(tracer opentracing.Tracer) grpc.UnaryServerInterceptor
- func NewNoopTracer() (opentracing.Tracer, error)
- func NewZipkinTracer(endpoint string, serviceName string, servicePort int) (opentracing.Tracer, error)
Constants ¶
const ( // TraceHTTPHeader is the header that will be used to expose the trace ID. TraceHTTPHeader = "X-Wercker-Trace-Id" // TraceFieldKey is the key that will be used for the field key. TraceFieldKey = "traceID" )
Variables ¶
This section is empty.
Functions ¶
func ExposeHandler ¶
ExposeHandler decorates another http.Handler. It will check the context defined on the incoming http.Request for a traceID. If it is found it will add this to the response header and to the fields in the context.
func ExposeInterceptor ¶
func ExposeInterceptor() grpc.UnaryServerInterceptor
ExposeInterceptor extracts the TraceID from the context and adds it to fields in the context.
func ExtractTraceID ¶
ExtractTraceID extracts the TraceID from a opentracing enabled context. Currently only the zipkin implementation is supported. Returns an empty string when no opentracing span was found, or a unsupported implementation was used.
func HTTPMiddleware ¶
HTTPMiddleware adds a opentracing middleware, and exposes the TraceID.
func Interceptor ¶
func Interceptor(tracer opentracing.Tracer) grpc.UnaryServerInterceptor
Interceptor adds a opentracing middleware, and exposes the TraceID.
func NewNoopTracer ¶
func NewNoopTracer() (opentracing.Tracer, error)
NewNoopTracer creates a Tracer which still uses the zipkin Tracer but none of the traces will be sampled. This still allows for a unique TraceID to be generated.
func NewZipkinTracer ¶
func NewZipkinTracer(endpoint string, serviceName string, servicePort int) (opentracing.Tracer, error)
NewZipkinTracer creates a new Tracer which uses Zipkin as the backend store.
Types ¶
This section is empty.