mirror of
https://github.com/hanzoai/traces.git
synced 2026-10-30 18:20:41 +00:00
* Update dskit for gRPC interface change * Update vendor * Update vendor * bump dskit * update go.sum * manifest --------- Co-authored-by: javiermolinar <[email protected]>
30 lines
742 B
Go
30 lines
742 B
Go
package tracing
|
|
|
|
import (
|
|
"github.com/opentracing/opentracing-go"
|
|
"github.com/opentracing/opentracing-go/ext"
|
|
"go.opentelemetry.io/otel/trace"
|
|
)
|
|
|
|
var _ SpanOption = SpanKindRPCClient{}
|
|
|
|
type SpanOption interface {
|
|
opentracingSpanOptions() []opentracing.StartSpanOption
|
|
otelSpanOptions() []trace.SpanStartOption
|
|
apply(*Span)
|
|
}
|
|
|
|
type SpanKindRPCClient struct{}
|
|
|
|
func (SpanKindRPCClient) opentracingSpanOptions() []opentracing.StartSpanOption { return nil }
|
|
|
|
func (SpanKindRPCClient) otelSpanOptions() []trace.SpanStartOption {
|
|
return []trace.SpanStartOption{trace.WithSpanKind(trace.SpanKindClient)}
|
|
}
|
|
|
|
func (SpanKindRPCClient) apply(span *Span) {
|
|
if span.opentracingSpan != nil {
|
|
ext.SpanKindRPCClient.Set(span.opentracingSpan)
|
|
}
|
|
}
|