Versions in this module Expand all Collapse all v0 v0.2.0 May 25, 2022 Changes in this version + const SpanIDSize + const TimestampLayout + const TraceIDSize + func InitHostname() + func RoundDur(d time.Duration) string + func SetHostname(hn string) + type ComponentName string + func (c ComponentName) String() string + type Enricher interface + Enrich func(span *Span) *Span + type Exporter interface + Shutdown func(ctx context.Context) error + Write func(ctx context.Context, spans []*Span) error + type ExportersSlice []Exporter + func (t ExportersSlice) Shutdown(ctx context.Context) error + func (t ExportersSlice) Write(ctx context.Context, spans []*Span) error + type Factory struct + func NewFactory(exporters ...Exporter) *Factory + func (tf *Factory) AddExporter(exporter Exporter) *Factory + func (tf *Factory) Named(componentName ComponentName) Tracer + func (tf *Factory) NamedPkg() Tracer + func (tf *Factory) Shutdown(ctx context.Context) error + type LogLevel int + const Error + const Fatal + const Info + const Warn + func (l LogLevel) String() string + type MockExporter struct + func NewMockExporter(ctrl *gomock.Controller) *MockExporter + func (m *MockExporter) EXPECT() *MockExporterMockRecorder + func (m *MockExporter) Shutdown(ctx context.Context) error + func (m *MockExporter) Write(ctx context.Context, spans []*Span) error + type MockExporterMockRecorder struct + func (mr *MockExporterMockRecorder) Shutdown(ctx interface{}) *gomock.Call + func (mr *MockExporterMockRecorder) Write(ctx, spans interface{}) *gomock.Call + type MockTracer struct + func NewMockTracer(ctrl *gomock.Controller) *MockTracer + func (m *MockTracer) EXPECT() *MockTracerMockRecorder + func (m *MockTracer) Finish(span *Span) + func (m *MockTracer) Name() ComponentName + type MockTracerMockRecorder struct + func (mr *MockTracerMockRecorder) Finish(span interface{}) *gomock.Call + func (mr *MockTracerMockRecorder) Name() *gomock.Call + type NilExporterTracer struct + func (NilExporterTracer) Finish(*Span) + func (NilExporterTracer) Name() ComponentName + func (NilExporterTracer) Shutdown(context.Context) error + func (NilExporterTracer) Write(context.Context, []*Span) error + type ObjectVal struct + func ValJson(v string) *ObjectVal + func ValObject(obj interface{}) *ObjectVal + func (o ObjectVal) MarshalJSON() ([]byte, error) + func (o ObjectVal) String() string + type Span struct + func CreateErrSpanFrom(ctx context.Context, span *Span) *Span + func CtxActiveSpan(ctx context.Context) *Span + func Message(message string, opts ...SpanOption) *Span + func Start(ctx1 context.Context, opts ...SpanOption) (span *Span, ctx context.Context) + func StartFromParentID(ctx context.Context, parentSpanID SpanID, traceID TraceID) (*Span, context.Context) + func StartLeaf(ctx context.Context, opts ...SpanOption) (span *Span) + func (s *Span) Class() string + func (s *Span) Component() ComponentName + func (s *Span) DeferErr(err error) *Span + func (s *Span) DeferErrs() error + func (s *Span) Duration() time.Duration + func (s *Span) EWState() string + func (s *Span) EnrichFrom(e Enricher) *Span + func (s *Span) Err(err error) error + func (s *Span) ErrRecover(rec interface{}, stackBytes []byte) *Span + func (s *Span) ErrSpan(err error) *Span + func (s *Span) ErrVoid(err error) + func (s *Span) ErrWrapf(err error, format string, args ...interface{}) error + func (s *Span) Errs() error + func (s *Span) FlushTo(trs Tracer) + func (s *Span) GlobalTag(key string, value interface{}) *Span + func (s *Span) HasDeferErr() bool + func (s *Span) HasErr() bool + func (s *Span) HasWarn() bool + func (s *Span) Host() string + func (s *Span) ID() SpanID + func (s *Span) IsFinished() bool + func (s *Span) Json() ([]byte, error) + func (s *Span) Level(level LogLevel) *Span + func (s *Span) Message(message string) *Span + func (s *Span) Name() string + func (s *Span) OverrideName(newName string) *Span + func (s *Span) Package() string + func (s *Span) PackageClass() string + func (s *Span) Parent() *Span + func (s *Span) ParentID() SpanID + func (s *Span) SetComponent(name ComponentName) + func (s *Span) Stack() []*Span + func (s *Span) StartedTs() time.Time + func (s *Span) Stop() + func (s *Span) Stringify(endWith ...string) string + func (s *Span) Tag(key string, value interface{}) *Span + func (s *Span) Tags() map[string]interface{} + func (s *Span) TraceID() TraceID + func (s *Span) Val(key string, value interface{}) *Span + func (s *Span) ValAsJson(key string, value string) *Span + func (s *Span) ValAsObj(key string, value interface{}) *Span + func (s *Span) Vals() map[string]interface{} + func (s *Span) Warn(err error) *Span + func (s *Span) WarnWith(err error) error + func (s *Span) Warns() error + type SpanID [8]byte + func NewSpanID() (res SpanID) + func ParseSpanID(spanID string) (res SpanID, err error) + func SpanIDFromBytes(bb []byte) (res SpanID, err error) + func SpanIDFromBytesOrZero(bb []byte) SpanID + func SpanIDFromString(s string) (res SpanID, err error) + func (s *SpanID) UnmarshalJSON(bb []byte) error + func (s SpanID) AsNullableBytes() []byte + func (s SpanID) Bytes() []byte + func (s SpanID) IsZero() bool + func (s SpanID) MarshalJSON() ([]byte, error) + func (s SpanID) MarshalText() ([]byte, error) + func (s SpanID) String() string + type SpanOption interface + func WithDone(ts time.Time, duration time.Duration) SpanOption + func WithName(name string) SpanOption + func WithPackageClass(p, c string) SpanOption + func WithParentSpanID(parentSpanID SpanID) SpanOption + func WithTimestamp(ts time.Time) SpanOption + func WithTraceID(traceID TraceID) SpanOption + type SpanSlice []*Span + type StringAsJSONVal struct + func (o StringAsJSONVal) MarshalJSON() ([]byte, error) + func (o StringAsJSONVal) String() string + type TraceID uuid.UUID + func NewTraceID() TraceID + func TraceIDFromBytes(bb []byte) (TraceID, error) + func TraceIDFromBytesOrZero(bb []byte) TraceID + func TraceIDFromString(traceID string) (res TraceID, err error) + func (t *TraceID) UnmarshalJSON(bb []byte) error + func (t TraceID) AsNullableUUID() *uuid.UUID + func (t TraceID) AsUUID() uuid.UUID + func (t TraceID) Bytes() []byte + func (t TraceID) IsZero() bool + func (t TraceID) MarshalJSON() ([]byte, error) + func (t TraceID) MarshalText() ([]byte, error) + func (t TraceID) String() string + type Tracer interface + Finish func(span *Span) + Name func() ComponentName + func NewTestErrTracker(t *testing.T, trs Tracer) Tracer + type TracerProvider interface + Named func(componentName ComponentName) Tracer + NamedPkg func() Tracer + type WriterExporter struct + func NewWriterExporter(writer io.Writer) *WriterExporter + func (w WriterExporter) Shutdown(context.Context) error + func (w WriterExporter) Write(ctx context.Context, spans []*Span) error + type WriterTracer struct + func NewWriterTracer(trs Tracer) *WriterTracer + func (t WriterTracer) Printf(ctx context.Context, format string, v ...interface{}) + func (t WriterTracer) Write(p []byte) (n int, err error)