2020-09-10 00:06:29 +03:00
|
|
|
package tracer
|
|
|
|
|
|
|
|
import "context"
|
|
|
|
|
2020-10-16 09:38:57 +03:00
|
|
|
type NoopTracer struct{}
|
2020-09-10 00:06:29 +03:00
|
|
|
|
2020-10-16 09:38:57 +03:00
|
|
|
func (n *NoopTracer) Init(...Option) error {
|
2020-09-10 00:06:29 +03:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-10-16 09:38:57 +03:00
|
|
|
func (n *NoopTracer) Start(ctx context.Context, name string) (context.Context, *Span) {
|
2020-09-10 00:06:29 +03:00
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
2020-10-16 09:38:57 +03:00
|
|
|
func (n *NoopTracer) Finish(*Span) error {
|
2020-09-10 00:06:29 +03:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-10-16 09:38:57 +03:00
|
|
|
func (n *NoopTracer) Read(...ReadOption) ([]*Span, error) {
|
2020-09-10 00:06:29 +03:00
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
2020-10-16 09:38:57 +03:00
|
|
|
func NewTracer(opts ...Option) Tracer {
|
|
|
|
return &NoopTracer{}
|
2020-09-10 00:06:29 +03:00
|
|
|
}
|