refactor(tracing.opentracing): use ContextWithSpan after applying tags
just cosmetics
Alexander Babai
3 years ago
40 | 40 | span = tracer.StartSpan(operationName) |
41 | 41 | } |
42 | 42 | defer span.Finish() |
43 | ctx = opentracing.ContextWithSpan(ctx, span) | |
44 | 43 | |
45 | 44 | applyTags(span, cfg.Tags) |
46 | 45 | if cfg.GetTags != nil { |
47 | 46 | extraTags := cfg.GetTags(ctx) |
48 | 47 | applyTags(span, extraTags) |
49 | 48 | } |
49 | ||
50 | ctx = opentracing.ContextWithSpan(ctx, span) | |
50 | 51 | |
51 | 52 | response, err := next(ctx, request) |
52 | 53 | if err := identifyError(response, err, cfg.IgnoreBusinessError); err != nil { |