Documentation
¶
Index ¶
- type RichSpan
- func (r RichSpan) End(err *error)
- func (r RichSpan) Err(err error) error
- func (r RichSpan) Event(name string)
- func (r RichSpan) Log() *zerolog.Logger
- func (r RichSpan) Name() string
- func (r RichSpan) Set(key string, val any) RichSpan
- func (r RichSpan) Span() trace.Span
- func (r RichSpan) TraceID() string
- type SpanBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RichSpan ¶
type RichSpan struct {
// contains filtered or unexported fields
}
func (RichSpan) End ¶
End ends the span. Meant to be called in defer. Optional error argument expects a pointer to named return parameter to automatically mark span as errored.
func (RichSpan) Err ¶
Err records error in span and marks span as errored. Returns error without modification. Recommended use: span.Err(richerr.Wrap(err)).
type SpanBuilder ¶
type SpanBuilder struct {
// contains filtered or unexported fields
}
func Name ¶
func Name(name string) SpanBuilder
Name sets span name. If Name is not invoked before Start span name is set automatically using runtime.Caller().
func WithArg ¶
func WithArg(value any) SpanBuilder
WithArg sets span attribute under key "richspan.argument". Primariy meant to be for functions that take only one argument. Consecutive calls overwrite previous value.
func (SpanBuilder) With ¶
func (sb SpanBuilder) With(key string, value any) SpanBuilder
With sets span attribute.
func (SpanBuilder) WithArg ¶
func (sb SpanBuilder) WithArg(value any) SpanBuilder
WithArg sets span attribute under key "richspan.argument". Primariy meant to be for functions that take only one argument. Consecutive calls overwrite previous value.