mirror of
https://github.com/go-kratos/kratos.git
synced 2025-03-17 21:07:54 +02:00
fix zipkin servicename
This commit is contained in:
parent
77b3a80d94
commit
908e196df4
@ -27,7 +27,11 @@ type Span struct {
|
||||
childs int
|
||||
}
|
||||
|
||||
func (s *Span) Name() string {
|
||||
func (s *Span) ServiceName() string {
|
||||
return s.operationName
|
||||
}
|
||||
|
||||
func (s *Span) OperationName() string {
|
||||
return s.operationName
|
||||
}
|
||||
|
||||
|
@ -37,11 +37,12 @@ func (r *report) WriteSpan(raw *trace.Span) (err error) {
|
||||
ID: spanID,
|
||||
ParentID: &parentID,
|
||||
},
|
||||
Name: raw.Name(),
|
||||
Name: raw.OperationName(),
|
||||
Timestamp: raw.StartTime(),
|
||||
Duration: raw.Duration(),
|
||||
Tags: make(map[string]string, len(tags)+len(logs)),
|
||||
}
|
||||
span.LocalEndpoint = &model.Endpoint{ServiceName: raw.ServiceName()}
|
||||
for _, tag := range tags {
|
||||
switch tag.Key {
|
||||
case trace.TagSpanKind:
|
||||
@ -55,8 +56,6 @@ func (r *report) WriteSpan(raw *trace.Span) (err error) {
|
||||
case "consumer":
|
||||
span.Kind = model.Consumer
|
||||
}
|
||||
case trace.TagPeerService:
|
||||
span.LocalEndpoint = &model.Endpoint{ServiceName: tag.Value.(string)}
|
||||
default:
|
||||
v, ok := tag.Value.(string)
|
||||
if ok {
|
||||
|
Loading…
x
Reference in New Issue
Block a user