diff --git a/bridge/opentracing/bridge.go b/bridge/opentracing/bridge.go index e326be19daf..fd84fa5062f 100644 --- a/bridge/opentracing/bridge.go +++ b/bridge/opentracing/bridge.go @@ -18,6 +18,7 @@ import ( "context" "fmt" "net/http" + "reflect" "strings" "sync" @@ -497,8 +498,9 @@ func otTagsToOTelAttributesKindAndError(tags map[string]interface{}) ([]attribut for k, v := range tags { switch k { case string(otext.SpanKind): - if s, ok := v.(otext.SpanKindEnum); ok { - switch strings.ToLower(string(s)) { + refValue := reflect.ValueOf(v) + if refValue.Kind() == reflect.String { + switch strings.ToLower(refValue.String()) { case "client": kind = trace.SpanKindClient case "server": diff --git a/bridge/opentracing/mix_test.go b/bridge/opentracing/mix_test.go index 0cd5a667ca5..1692a4e1a5b 100644 --- a/bridge/opentracing/mix_test.go +++ b/bridge/opentracing/mix_test.go @@ -20,6 +20,7 @@ import ( "testing" ot "github.com/opentracing/opentracing-go" + "github.com/opentracing/opentracing-go/ext" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" @@ -637,7 +638,7 @@ func runOtelOTOtel(t *testing.T, ctx context.Context, name string, callback func func runOTOtelOT(t *testing.T, ctx context.Context, name string, callback func(*testing.T, context.Context) context.Context) { tr := otel.Tracer("") - span, ctx := ot.StartSpanFromContext(ctx, fmt.Sprintf("%s_OT_OtelOT", name), ot.Tag{Key: "span.kind", Value: "client"}) + span, ctx := ot.StartSpanFromContext(ctx, fmt.Sprintf("%s_OT_OtelOT", name), ot.Tag{Key: "span.kind", Value: ext.SpanKindRPCClient.Value}) defer span.Finish() ctx = callback(t, ctx) func(ctx2 context.Context) {