src/client/pkg/tracing/tracing.go
func AddSpanToAnyExisting(ctx context.Context, operation string, kvs ...interface{}) (opentracing.Span, context.Context) {
	if parentSpan := opentracing.SpanFromContext(ctx); parentSpan != nil {
		span := opentracing.StartSpan(operation, opentracing.ChildOf(parentSpan.Context()))
		tagSpan(span, kvs)
		return span, opentracing.ContextWithSpan(ctx, span)
	}
	return nil, ctx
}
func AddSpanToAnyExisting(ctx context.Context, operation string, kvs ...interface{}) (opentracing.Span, context.Context) {
	if parentSpan := opentracing.SpanFromContext(ctx); parentSpan != nil {
		span := opentracing.StartSpan(operation, opentracing.ChildOf(parentSpan.Context()))
		tagSpan(span, kvs)
		return span, opentracing.ContextWithSpan(ctx, span)
	}
	return nil, ctx
}
func AddSpanToAnyExisting ( ctx context . Context , operation string , kvs ... interface { } ) ( opentracing . Span , context . Context ) { if parentSpan := opentracing . SpanFromContext ( ctx ) ; parentSpan != nil { span := opentracing . StartSpan ( operation , opentracing . ChildOf ( parentSpan . Context ( ) ) ) tagSpan ( span , kvs ) return span , opentracing . ContextWithSpan ( ctx , span ) } return nil , ctx }
// AddSpanToAnyExisting checks 'ctx' for Jaeger tracing information, and if
// tracing metadata is present, it generates a new span for 'operation', marks
// it as a child of the existing span, and returns it.
AddSpanToAnyExisting checks ctx for Jaeger tracing information and if tracing metadata is present it generates a new span for operation marks it as a child of the existing span and returns it .