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.
23 lines
579 B
Go
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 }
|