Documentation ¶
Index ¶
- type Observe
- func (obs *Observe) AddField(key string, value interface{})
- func (obs *Observe) Debug(args ...interface{})
- func (obs *Observe) Debugf(format string, args ...interface{})
- func (obs *Observe) Debugln(args ...interface{})
- func (obs *Observe) End(retErr *error)
- func (obs *Observe) Error(args ...interface{})
- func (obs *Observe) Errorf(format string, args ...interface{})
- func (obs *Observe) Errorln(args ...interface{})
- func (obs *Observe) Fatal(args ...interface{})
- func (obs *Observe) Fatalf(format string, args ...interface{})
- func (obs *Observe) Fatalln(args ...interface{})
- func (obs *Observe) Info(args ...interface{})
- func (obs *Observe) Infof(format string, args ...interface{})
- func (obs *Observe) Infoln(args ...interface{})
- func (obs *Observe) Log(level logrus.Level, args ...interface{})
- func (obs *Observe) Logf(level logrus.Level, format string, args ...interface{})
- func (obs *Observe) Logln(level logrus.Level, args ...interface{})
- func (obs *Observe) Panic(args ...interface{})
- func (obs *Observe) Panicf(format string, args ...interface{})
- func (obs *Observe) Panicln(args ...interface{})
- func (obs *Observe) Print(args ...interface{})
- func (obs *Observe) Printf(format string, args ...interface{})
- func (obs *Observe) Println(args ...interface{})
- func (obs *Observe) Trace(args ...interface{})
- func (obs *Observe) Tracef(format string, args ...interface{})
- func (obs *Observe) Traceln(args ...interface{})
- func (obs *Observe) Warn(args ...interface{})
- func (obs *Observe) Warnf(format string, args ...interface{})
- func (obs *Observe) Warning(args ...interface{})
- func (obs *Observe) Warningf(format string, args ...interface{})
- func (obs *Observe) Warningln(args ...interface{})
- func (obs *Observe) Warnln(args ...interface{})
- func (obs *Observe) WithError(err error) *Observe
- type Option
- type StaticObserveFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Observe ¶
type Observe struct { Span opentracing.Span // Thin wrapper, thus this is public field in case someone needs underlying StaticObserveFactory // contains filtered or unexported fields }
func (*Observe) AddField ¶
AddField adds persistant field to this Span. It's attribute in traces and field in logrus
func (*Observe) End ¶
End marks Span as ended. Metrics are calculated on in and if the error occurs it's included in the metrics and trace.
type Option ¶
type Option func(cfg *Observe)
func WithTraceOptions ¶
func WithTraceOptions(opts ...opentracing.StartSpanOption) Option
WithTraceOptions
type StaticObserveFactory ¶
type StaticObserveFactory struct {
// contains filtered or unexported fields
}
func New ¶
func New(name string) StaticObserveFactory
func (StaticObserveFactory) FromContext ¶
func (f StaticObserveFactory) FromContext(ctx context.Context, opts ...Option) (context.Context, *Observe)
FromContext created Observe --> the thin wrapper this library is all about
The returned observe shouldn't really pass the function boundary, and it is definitely **not** thread safe. It's by design. It's intended usage is in the first two lines of the function (which can be called from multiple goroutines, that's fine)
Click to show internal directories.
Click to hide internal directories.