diff --git a/instrumentation.go b/instrumentation.go index 434de14e..90b1a684 100644 --- a/instrumentation.go +++ b/instrumentation.go @@ -9,19 +9,19 @@ import ( // Instrumenter defines function type that can be used for instrumetation. // This function should return a function with no argument as a callback for finished execution. -type Instrumenter func(ctx context.Context, op string, message string) func(err error) +type Instrumenter func(ctx context.Context, op string, message string, args ...any) func(err error) // Observe operation. -func (i Instrumenter) Observe(ctx context.Context, op string, message string) func(err error) { +func (i Instrumenter) Observe(ctx context.Context, op string, message string, args ...any) func(err error) { if i != nil { - return i(ctx, op, message) + return i(ctx, op, message, args) } return func(err error) {} } // DefaultLogger instrumentation to log queries and rel operation. -func DefaultLogger(ctx context.Context, op string, message string) func(err error) { +func DefaultLogger(ctx context.Context, op string, message string, args ...any) func(err error) { // no op for rel functions. if strings.HasPrefix(op, "rel-") { return func(error) {}