diff --git a/example_instrumentation_test.go b/example_instrumentation_test.go index 9e8179a5..e03956ee 100644 --- a/example_instrumentation_test.go +++ b/example_instrumentation_test.go @@ -14,7 +14,10 @@ var _ redis.Hook = redisHook{} func (redisHook) DialHook(hook redis.DialHook) redis.DialHook { return func(ctx context.Context, network, addr string) (net.Conn, error) { - return hook(ctx, network, addr) + fmt.Printf("dialing %s %s\n", network, addr) + conn, err := hook(ctx, network, addr) + fmt.Printf("finished dialing %s %s\n", network, addr) + return conn, err } } @@ -44,6 +47,8 @@ func Example_instrumentation() { rdb.Ping(ctx) // Output: starting processing: + // dialing tcp :6379 + // finished dialing tcp :6379 // finished processing: } diff --git a/extra/redisotel/README.md b/extra/redisotel/README.md index 66c33c9c..d9c2e0dd 100644 --- a/extra/redisotel/README.md +++ b/extra/redisotel/README.md @@ -21,4 +21,6 @@ rdb := rdb.NewClient(&rdb.Options{...}) rdb.AddHook(redisotel.NewTracingHook()) ``` -See [example](example) and [documentation](https://redis.uptrace.dev/tracing/) for more details. +See [example](example) and +[Monitoring Go Redis Performance and Errors](https://redis.uptrace.dev/guide/go-redis-monitoring.html) +for details.