# README
tracer-go
Distributed tracing tools used by Accelbyte Implemented to use jaeger tracing system and zipkin headers to pass spans
usage
jaegerAgentHost := "" // jaeger:6831
jaegerAgentEndpoint := "http://jaeger:14268/api/traces"
serviceName := "test"
realm := "node1"
closer := InitGlobalTracer(jaegerAgentHost, jaegerAgentEndpoint, serviceName, realm)
defer closer.Close()
# 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.
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.
TraceError sends a log and a tag with Error into tracer.
TraceSQLQuery sends a log with SQL query into tracer.