Files
virtual-kubelet/trace/nop.go
Brian Goff d6b5ae3710 Remove usage of ocstatus package
This changes the tracing package to accept an error on SetStatus, which
is really what we always want anyway.
This also decouples the trace package from opencensus.
2019-06-04 14:29:25 -07:00

23 lines
579 B
Go

package trace
import (
"context"
"github.com/virtual-kubelet/virtual-kubelet/log"
)
type nopTracer struct{}
func (nopTracer) StartSpan(ctx context.Context, _ string) (context.Context, Span) {
return ctx, &nopSpan{}
}
type nopSpan struct{}
func (nopSpan) End() {}
func (nopSpan) SetStatus(error) {}
func (nopSpan) Logger() log.Logger { return nil }
func (nopSpan) WithField(ctx context.Context, _ string, _ interface{}) context.Context { return ctx }
func (nopSpan) WithFields(ctx context.Context, _ log.Fields) context.Context { return ctx }