Skip to content

Commit

Permalink
Merge pull request #144 from openzipkin-contrib/fix-propagation
Browse files Browse the repository at this point in the history
Improve handling of span.kind OT tag
  • Loading branch information
basvanbeek authored Aug 16, 2019
2 parents 96c6170 + 201003a commit 1c852e0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,16 @@ func parseTagsAsZipkinOptions(t map[string]interface{}) []zipkin.SpanOption {
tags := map[string]string{}
remoteEndpoint := &model.Endpoint{}

var kind string
if val, ok := t[string(ext.SpanKind)]; ok {
kind, _ := val.(string)
switch kindVal := val.(type) {
case ext.SpanKindEnum:
kind = string(kindVal)
case string:
kind = kindVal
default:
kind = fmt.Sprintf("%v", kindVal)
}
zopts = append(zopts, zipkin.Kind(model.Kind(strings.ToUpper(kind))))
}

Expand Down

0 comments on commit 1c852e0

Please sign in to comment.