# README
Jaeger
This package contains filter for generating jaeger span
Usage
Importing
import "github.com/AccelByte/go-restful-plugins/v4/pkg/jaeger"
Filter
Filter is restful.FilterFunction for generating jaeger span using zipkin headers
Example usage of filter for all endpoints
span := GetSpanFromRestfulContext(request.Request.Context())
// to add a tag
AddTag(span, "exampleTag", "tag_value")
//to add a baggage item
AddBaggage(span, "exampleBaggage", "example")
// to add a log
AddLog(span, "exampleLog", "example")
# Functions
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.
AddLog to add string log in span if span is valid.
AddTag to add tag in span if span is valid.
No description provided by the author
ExtractRequestHeader to extract SpanContext from request header.
No description provided by the author
Finish to finish span if it is exist.
No description provided by the author
GetSpanFromRestfulContext get crated by jaeger Filter span from the context.
InitGlobalTracer initialize global tracer Must be called in main function.
No description provided by the author
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.
No description provided by the author
StartDBSpan start DBSpan from context.
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.
StartSpanFromContext start span from context if context != nil.
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.
No description provided by the author
TraceError sends a log and a tag with Error into tracer.
TraceSQLQuery sends a log with SQL query into tracer.