StartSpanWithName starts a new span with the given name from the context. If a tracer name was set on the context (or one of its parents), it will be used as the tracer name instead of the default TracerName.
(ctx context.Context, name string, opts ...trace.SpanStartOption)
| 123 | // a tracer name was set on the context (or one of its parents), it will be used |
| 124 | // as the tracer name instead of the default TracerName. |
| 125 | func StartSpanWithName(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span) { |
| 126 | tracerName := GetTracerName(ctx) |
| 127 | return trace.SpanFromContext(ctx). |
| 128 | TracerProvider(). |
| 129 | Tracer(tracerName). |
| 130 | Start(ctx, name, opts...) |
| 131 | } |
no test coverage detected