1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-23 22:34:47 +02:00

Send span.kind to jaeger and overwrite grpc metadata instead of using append (#441)

Co-authored-by: Rahul Patel <rghetia@yahoo.com>
This commit is contained in:
Amr Hanafi
2020-01-31 14:03:04 -08:00
committed by GitHub
parent 405a92ab3e
commit 8fcdf8be73
3 changed files with 10 additions and 4 deletions

View File

@@ -16,7 +16,6 @@ package grpctrace
import (
"context"
"strings"
"google.golang.org/grpc/metadata"
@@ -34,11 +33,14 @@ type metadataSupplier struct {
func (s *metadataSupplier) Get(key string) string {
values := s.metadata.Get(key)
return strings.Join(values, ",")
if len(values) == 0 {
return ""
}
return values[0]
}
func (s *metadataSupplier) Set(key string, value string) {
s.metadata.Append(key, value)
s.metadata.Set(key, value)
}
// Inject injects correlation context and span context into the gRPC