Documentation ¶
Index ¶
- Constants
- func AddCorrelationIDsToContext(ctx context.Context, correlationID, traceID, spanID, parentSpanID string) context.Context
- func AttachCorrelationIDToContext() func(next http.Handler) http.Handler
- func CorrelationIDForRequest(request *http.Request) string
- func CorrelationIDFromContext(ctx context.Context) string
- func ParentSpanIDForRequest(request *http.Request) string
- func ParentSpanIDFromContext(ctx context.Context) string
- func SaveCorrelationKeyValuePairToContext(ctx context.Context, key, value string) context.Context
- func SaveToContext(ctx context.Context, headers Headers) context.Context
- func SpanIDForRequest(request *http.Request) string
- func SpanIDFromContext(ctx context.Context) string
- func TraceIDForRequest(request *http.Request) string
- func TraceIDFromContext(ctx context.Context) string
- type Headers
Constants ¶
const ( // RequestIDHeaderKey missing godoc RequestIDHeaderKey = "x-request-id" // TraceIDHeaderKey missing godoc TraceIDHeaderKey = "x-b3-traceid" // SpanIDHeaderKey missing godoc SpanIDHeaderKey = "x-b3-spanid" // ParentSpanIDHeaderKey missing godoc ParentSpanIDHeaderKey = "x-b3-parentspanid" )
const HeadersContextKey contextKey = "CorrelationHeaders"
HeadersContextKey missing godoc
Variables ¶
This section is empty.
Functions ¶
func AddCorrelationIDsToContext ¶
func AddCorrelationIDsToContext(ctx context.Context, correlationID, traceID, spanID, parentSpanID string) context.Context
AddCorrelationIDsToContext add all correlation IDs to the context
func AttachCorrelationIDToContext ¶
AttachCorrelationIDToContext returns middleware that attaches all headers used for tracing in the current request.
func CorrelationIDForRequest ¶
CorrelationIDForRequest returns the correlation ID for the current request
func CorrelationIDFromContext ¶
CorrelationIDFromContext returns correlation ID from the given context
func ParentSpanIDForRequest ¶
ParentSpanIDForRequest returns the parent span ID for the current request
func ParentSpanIDFromContext ¶
ParentSpanIDFromContext returns parent span ID from the given context
func SaveCorrelationKeyValuePairToContext ¶
SaveCorrelationKeyValuePairToContext saves the provided correlation key/value pair in the specified context
func SaveToContext ¶
SaveToContext saves the provided headers as correlation ID headers in the specified context
func SpanIDForRequest ¶
SpanIDForRequest returns the span ID for the current request
func SpanIDFromContext ¶
SpanIDFromContext returns span ID from the given context
func TraceIDForRequest ¶
TraceIDForRequest returns the trace ID for the current request
func TraceIDFromContext ¶
TraceIDFromContext returns trace ID from the given context
Types ¶
type Headers ¶
Headers missing godoc
func HeadersForRequest ¶
HeadersForRequest returns all http headers used for tracing of the passed request. If the request headers are not set, but are part of the context, they're set as headers as well. If the x-request-id header does not exists a new one is generated, and set as a header.
func HeadersFromContext ¶
HeadersFromContext returns the headers for the provided context