tracing

package
v0.0.0-...-83a4208 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsDebugEnabled = func() bool { return false }

Functions

func EndTraceSpan

func EndTraceSpan(span trace.Span, opts ...TraceAttrOption)

EndTraceSpan ends span, optionally sets attributes

func GZIP

func GZIP(ctx context.Context, p []byte) (context.Context, []byte, error)

func HookRequestContext

func HookRequestContext(ctx context.Context, req *http.Request) (context.Context, *http.Request)

func StartTraceSpan

func StartTraceSpan(ctx context.Context, tracerName, spanName string, opts ...trace.SpanStartOption) (context.Context, trace.Span)

StartTraceSpan starts a span

Types

type TraceAttrOption

type TraceAttrOption func(span trace.Span)

TraceAttrOption defines option to set span attribute

func TraceAttrEntrypoint

func TraceAttrEntrypoint(v string) TraceAttrOption

TraceAttrEntrypoint sets an entrypoint attribute

func TraceAttrError

func TraceAttrError(v error) TraceAttrOption

TraceAttrError sets an error attribute

func TraceAttrFnDbg

func TraceAttrFnDbg(k string, fn func() string) TraceAttrOption

TraceAttrFnDbg sets an attribute with Function if Debug is enabled

func TraceAttrInt

func TraceAttrInt(k string, v int) TraceAttrOption

TraceAttrInt sets an int attribute

func TraceAttrPayload

func TraceAttrPayload(v []byte) TraceAttrOption

TraceAttrPayload sets a payload attribute

func TraceAttrPayloadDbg

func TraceAttrPayloadDbg(v []byte) TraceAttrOption

TraceAttrPayloadDbg sets a payload attribute if Debug is enabled

func TraceAttrPayloadLen

func TraceAttrPayloadLen(v []byte) TraceAttrOption

TraceAttrPayloadLen sets a payloadLen attribute

func TraceAttrStr

func TraceAttrStr(k, v string) TraceAttrOption

TraceAttrStr sets a string attribute

func TraceAttrStrs

func TraceAttrStrs(k string, v []string) TraceAttrOption

TraceAttrStrs sets an string slice attribute

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL