File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,11 @@ import (
10
10
11
11
type TracingHook struct {}
12
12
13
- var _ redis.Hook = TracingHook {}
13
+ var _ redis.Hook = (* TracingHook )(nil )
14
+
15
+ func NewTracingHook () * TracingHook {
16
+ return new (TracingHook )
17
+ }
14
18
15
19
func (TracingHook ) BeforeProcess (ctx context.Context , cmd redis.Cmder ) (context.Context , error ) {
16
20
ctx , span := trace .StartSpan (ctx , cmd .FullName ())
Original file line number Diff line number Diff line change @@ -15,7 +15,11 @@ var tracer = otel.Tracer("github.com/go-redis/redis")
15
15
16
16
type TracingHook struct {}
17
17
18
- var _ redis.Hook = TracingHook {}
18
+ var _ redis.Hook = (* TracingHook )(nil )
19
+
20
+ func NewTracingHook () * TracingHook {
21
+ return new (TracingHook )
22
+ }
19
23
20
24
func (TracingHook ) BeforeProcess (ctx context.Context , cmd redis.Cmder ) (context.Context , error ) {
21
25
if ! trace .SpanFromContext (ctx ).IsRecording () {
You can’t perform that action at this time.
0 commit comments