Documentation ¶
Index ¶
- func AddBaggage(span opentracing.Span, key string, value string)
- func AddLog(span opentracing.Span, key string, value string)
- func AddTag(span opentracing.Span, key string, value string)
- func ChildSpanFromRemoteSpan(rootCtx context.Context, name string, spanContextStr string) (opentracing.Span, context.Context)
- func ExtractRequestHeader(req *restful.Request) (opentracing.SpanContext, error)
- func Filter() restful.FilterFunction
- func Finish(span opentracing.Span)
- func GetSpanContextString(span opentracing.Span) string
- func GetSpanFromRestfulContext(ctx context.Context) opentracing.Span
- func InitGlobalTracer(jaegerAgentHost string, jaegerCollectorEndpoint string, serviceName string, ...) io.Closer
- func InjectSpanIntoRequest(span opentracing.Span, req *http.Request) error
- func InjectTrace(ctx context.Context, incomingReq *restful.Request, outgoingReq *http.Request) (*http.Request, opentracing.Span, context.Context)
- func StartChildSpan(span opentracing.Span, name string) opentracing.Span
- func StartDBSpan(ctx context.Context, operationName string) (opentracing.Span, context.Context)
- func StartSpan(req *restful.Request, operationName string) (opentracing.Span, context.Context)
- func StartSpanFromContext(ctx context.Context, operationName string) (opentracing.Span, context.Context)
- func StartSpanIfParentSpanExist(req *restful.Request, operationName string) (opentracing.Span, context.Context)
- func TraceError(span opentracing.Span, err error)
- func TraceSQLQuery(span opentracing.Span, query string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBaggage ¶
AddBaggage to add baggage in span if span is valid sets a key:value pair on this Span and its SpanContext that also propagates to descendants of this Span.
func ChildSpanFromRemoteSpan ¶
func ExtractRequestHeader ¶
func ExtractRequestHeader(req *restful.Request) (opentracing.SpanContext, error)
ExtractRequestHeader to extract SpanContext from request header
func GetSpanContextString ¶
func GetSpanContextString(span opentracing.Span) string
func GetSpanFromRestfulContext ¶
GetSpanFromRestfulContext get crated by jaeger Filter span from the context
func InitGlobalTracer ¶
func InitGlobalTracer( jaegerAgentHost string, jaegerCollectorEndpoint string, serviceName string, realm string, ) io.Closer
InitGlobalTracer initialize global tracer Must be called in main function
func InjectSpanIntoRequest ¶
func InjectTrace ¶
func InjectTrace(ctx context.Context, incomingReq *restful.Request, outgoingReq *http.Request) (*http.Request, opentracing.Span, context.Context)
InjectTrace to inject request header with context from current span Span returned here must be finished with span.finish() Any span not finished will not be sent to jaeger agent
func StartChildSpan ¶
func StartChildSpan(span opentracing.Span, name string) opentracing.Span
func StartDBSpan ¶
StartDBSpan start DBSpan from context. Span returned here must be finished with span.finish() Any span not finished will not be sent to jaeger agent
func StartSpan ¶
StartSpan to start a new child span from restful.Request Span returned here must be finished with span.finish() Any span not finished will not be sent to jaeger agent
func StartSpanFromContext ¶
func StartSpanFromContext(ctx context.Context, operationName string) (opentracing.Span, context.Context)
StartSpanFromContext start span from context if context != nil. Span returned here must be finished with span.finish() Any span not finished will not be sent to jaeger agent
func StartSpanIfParentSpanExist ¶
func StartSpanIfParentSpanExist(req *restful.Request, operationName string) (opentracing.Span, context.Context)
StartSpanIfParentSpanExist to start a new child span from restful.Request if it contain SpanContext For example this function can be used in healthz endpoint,when we want to omit request from kubernetes liveness probe Span returned here must be finished with span.finish() Any span not finished will not be sent to jaeger agent
func TraceError ¶
func TraceError(span opentracing.Span, err error)
TraceError sends a log and a tag with Error into tracer
func TraceSQLQuery ¶
func TraceSQLQuery(span opentracing.Span, query string)
TraceSQLQuery sends a log with SQL query into tracer
Types ¶
This section is empty.