Skip to content

Commit

Permalink
Merge branch 'v1' into francois.mazeau/user-monitoring-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellzy committed Mar 2, 2022
2 parents eccc581 + 585a18a commit 89172ec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ddtrace/tracer/tracer.go
Expand Up @@ -412,6 +412,11 @@ func (t *tracer) StartSpan(operationName string, options ...ddtrace.StartSpanOpt
for k, v := range t.config.globalTags {
span.SetTag(k, v)
}
if t.config.serviceMappings != nil {
if newSvc, ok := t.config.serviceMappings[span.Service]; ok {
span.Service = newSvc
}
}
if context == nil || context.span == nil || context.span.Service != span.Service {
span.setMetric(keyTopLevel, 1)
// all top level spans are measured. So the measured tag is redundant.
Expand All @@ -430,11 +435,6 @@ func (t *tracer) StartSpan(operationName string, options ...ddtrace.StartSpanOpt
if t.config.profilerHotspots || t.config.profilerEndpoints {
t.applyPPROFLabels(pprofContext, span)
}
if t.config.serviceMappings != nil {
if newSvc, ok := t.config.serviceMappings[span.Service]; ok {
span.Service = newSvc
}
}
log.Debug("Started Span: %v, Operation: %s, Resource: %s, Tags: %v, %v", span, span.Name, span.Resource, span.Meta, span.Metrics)
return span
}
Expand Down

0 comments on commit 89172ec

Please sign in to comment.