func (r *hook) BeforeProcessPipeline(ctx context.Context, cmds []redis.Cmder) (context.Context, error) {
	// Join all cmd names with ", ".
	var cmdNameBuf bytes.Buffer
	for i, cmd := range cmds {
		if i != 0 {
			cmdNameBuf.WriteString(", ")
		}
		cmdNameBuf.WriteString(getCmdName(cmd))
	}

	pipelineSpan, ctx := opentracing.StartSpanFromContextWithTracer(ctx, r.tracer, cmdNameBuf.String())
	ext.Component.Set(pipelineSpan, "redis")
	ext.DBType.Set(pipelineSpan, "redis")
	ext.SpanKind.Set(pipelineSpan, "client")

	for i := len(cmds) - 1; i >= 0; i-- {
		cmdName := getCmdName(cmds[i])

		span, _ := opentracing.StartSpanFromContextWithTracer(ctx, r.tracer, cmdName)
		ext.Component.Set(span, "redis")
		ext.DBType.Set(span, "redis")
		ext.SpanKind.Set(span, "client")
		ext.DBStatement.Set(span, fmt.Sprintf("%v", cmds[i].Args()))
	}
	return ctx, nil
}
// BeforeProcessPipeline initiates the span for the redis cmds
BeforeProcessPipeline initiates the span for the redis cmds
// BeforeProcessPipeline initiates the span for the redis cmds
func (r *hook) BeforeProcessPipeline(ctx context.Context, cmds []redis.Cmder) (context.Context, error) {
	var cmdNameBuf bytes.Buffer
	for i, cmd := range cmds {
		if i != 0 {
			cmdNameBuf.WriteString(", ")
		}
		cmdNameBuf.WriteString(getCmdName(cmd))
	}
	pipelineSpan, ctx := opentracing.StartSpanFromContextWithTracer(ctx, r.tracer, cmdNameBuf.String())
	ext.Component.Set(pipelineSpan, "redis")
	ext.DBType.Set(pipelineSpan, "redis")
	ext.SpanKind.Set(pipelineSpan, "client")
	for i := len(cmds) - 1; i >= 0; i-- {
		cmdName := getCmdName(cmds[i])
		span, _ := opentracing.StartSpanFromContextWithTracer(ctx, r.tracer, cmdName)
		ext.Component.Set(span, "redis")
		ext.DBType.Set(span, "redis")
		ext.SpanKind.Set(span, "client")
		ext.DBStatement.Set(span, fmt.Sprintf("%v", cmds[i].Args()))
	}
	return ctx, nil
}
func ( r * hook ) BeforeProcessPipeline ( ctx context . Context , cmds [ ] redis . Cmder ) ( context . Context , error ) { var cmdNameBuf bytes . Buffer for i , cmd := range cmds { if i != 0 { cmdNameBuf . WriteString ( " " ) } cmdNameBuf . WriteString ( getCmdName ( cmd ) ) } pipelineSpan , ctx := opentracing . StartSpanFromContextWithTracer ( ctx , r . tracer , cmdNameBuf . String ( ) ) ext . Component . Set ( pipelineSpan , " " ) ext . DBType . Set ( pipelineSpan , " " ) ext . SpanKind . Set ( pipelineSpan , " " ) for i := len ( cmds ) - 1 ; i >= 0 ; i -- { cmdName := getCmdName ( cmds [ i ] ) span , _ := opentracing . StartSpanFromContextWithTracer ( ctx , r . tracer , cmdName ) ext . Component . Set ( span , " " ) ext . DBType . Set ( span , " " ) ext . SpanKind . Set ( span , " " ) ext . DBStatement . Set ( span , fmt . Sprintf ( " " , cmds [ i ] . Args ( ) ) ) } return ctx , nil }
BeforeProcessPipeline initiates the span for the redis cmds
BeforeProcessPipeline initiates the span for the redis cmds
// Join all cmd names with ", ".