Open schmidtw opened 5 years ago
@johnabass would we replace this dependence with candlelight?
looks like we're leverage the following from webpa-common/tracing
https://github.com/xmidt-org/wrp-go/blob/5acbd902ae2b8b6bc1e31cea75b8d682cd4371e3/wrpendpoint/requestResponse.go#L193-L217
// NewSpanner constructs a new Spanner with the given options. By default, a Spanner
// will use time.Now() to get the current time and time.Since() to compute durations.
func NewSpanner(o ...SpannerOption) Spanner {
sp := &spanner{
now: time.Now,
since: time.Since,
}
for _, option := range o {
option(sp)
}
return sp
}
// Mergeable represents a Spanned which can be merged with other spans
type Mergeable interface {
Spanned
// WithSpans returns an instance of this object with the new Spans, possibly
// merged into those returned by Spans. This method should generally return
// a shallow copy of itself with the new spans, to preserve immutability.
WithSpans(...Span) interface{}
}
// Span represents the result of some arbitrary section of code. Clients create Span objects
// via a Spanner. A Span is immutable once it has been created via a Spanner closure.
type Span interface {
// Name is the name of the operation
Name() string
// Start is the time at which the operation started
Start() time.Time
// Duration is how long the operation took. This value is computed once, when the
// closure from Spanner.Start is called.
Duration() time.Duration
// Error is any error that occurred. This will be the error passed to the closure
// returned from Spanner.Start. This error can be nil.
Error() error
}
assigning @renaz6 so she can let us know when candlelight is at a better state
The wrp-go package shouldn't depend on the tracing solution from webpa-common.