Versions in this module Expand all Collapse all v0 v0.6.2 Aug 10, 2020 Changes in this version + const KratosTraceDebug + const KratosTraceID + const LogErrorKind + const LogErrorObject + const LogEvent + const LogMessage + const LogStack + const TagAddress + const TagAnnotation + const TagComment + const TagComponent + const TagDBInstance + const TagDBStatement + const TagDBType + const TagDBUser + const TagError + const TagHTTPMethod + const TagHTTPStatusCode + const TagHTTPURL + const TagMessageBusDestination + const TagPeerAddress + const TagPeerHostname + const TagPeerIPv4 + const TagPeerIPv6 + const TagPeerPort + const TagPeerService + const TagSamplingPriority + const TagSpanKind + var ErrInvalidCarrier = errs.New("trace: Invalid Inject/Extract carrier") + var ErrInvalidTrace = errs.New("trace: Trace type incompatible with tracer") + var ErrTraceCorrupted = errs.New("trace: Trace data corrupted in Extract carrier") + var ErrTraceNotFound = errs.New("trace: Trace not found in Extract carrier") + var ErrUnsupportedFormat = errs.New("trace: Unknown or unsupported Inject/Extract format") + func Close() error + func Init(cfg *Config) + func Inject(t Trace, format interface{}, carrier interface{}) error + func NewContext(ctx context.Context, t Trace) context.Context + func SetGlobalTracer(tracer Tracer) + type BuiltinFormat byte + const GRPCFormat + const HTTPFormat + type Carrier interface + Get func(key string) string + Set func(key, val string) + type Config struct + Addr string + DisableSample bool + Network string + Probability float32 + ProtocolVersion int32 + Timeout xtime.Duration + type LogField struct + Key string + Value string + func Log(key string, val string) LogField + type Option func(*option) + func EnableDebug() Option + type Span struct + func (s *Span) Context() spanContext + func (s *Span) Duration() time.Duration + func (s *Span) Finish(perr *error) + func (s *Span) Follow(serviceName, operationName string) Trace + func (s *Span) Fork(serviceName, operationName string) Trace + func (s *Span) Logs() []*protogen.Log + func (s *Span) OperationName() string + func (s *Span) ServiceName() string + func (s *Span) SetLog(logs ...LogField) Trace + func (s *Span) SetTag(tags ...Tag) Trace + func (s *Span) SetTitle(operationName string) + func (s *Span) StartTime() time.Time + func (s *Span) String() string + func (s *Span) Tags() []Tag + func (s *Span) TraceID() string + func (s *Span) Visit(fn func(k, v string)) + type Tag struct + Key string + Value interface{} + func Bool(key string, val bool) Tag + func Int(key string, val int) Tag + func String(key string, val string) Tag + func TagBool(key string, val bool) Tag + func TagFloat32(key string, val float32) Tag + func TagFloat64(key string, val float64) Tag + func TagInt(key string, val int) Tag + func TagInt64(key string, val int64) Tag + func TagString(key string, val string) Tag + type Trace interface + Finish func(err *error) + Follow func(serviceName, operationName string) Trace + Fork func(serviceName, operationName string) Trace + SetLog func(logs ...LogField) Trace + SetTag func(tags ...Tag) Trace + SetTitle func(title string) + TraceID func() string + Visit func(fn func(k, v string)) + func Extract(format interface{}, carrier interface{}) (Trace, error) + func FromContext(ctx context.Context) (t Trace, ok bool) + func New(operationName string, opts ...Option) Trace + type Tracer interface + Extract func(format interface{}, carrier interface{}) (Trace, error) + Inject func(t Trace, format interface{}, carrier interface{}) error + New func(operationName string, opts ...Option) Trace + func NewTracer(serviceName string, report reporter, disableSample bool) Tracer + func TracerFromEnvFlag() (Tracer, error)