package utils import ( "context" log "github.com/sirupsen/logrus" "go.opentelemetry.io/otel/trace" ) // SetupTracing initializes a new trace span and logger for the given context and tracer. func SetupTracing(ctx context.Context, tracer trace.Tracer, tracerName string) (context.Context, trace.Span, *log.Entry) { ctx, span := tracer.Start(ctx, tracerName) localLogger := log.WithContext(ctx) return ctx, span, localLogger } // HandleEvent logs the provided event name and adds it to the given trace span. func HandleEvent(span trace.Span, logger *log.Entry, eventName string) { logger.Debug(eventName) span.AddEvent(eventName) }