From 74389af269c88ecb4caffe7dd49a46b43a279027 Mon Sep 17 00:00:00 2001 From: Kason Braley <59150626+KasonBraley@users.noreply.github.com> Date: Mon, 6 Feb 2023 23:40:00 -0700 Subject: [PATCH] docs: Update redisotel example for v9 (#2425) * docs: Update redisotel docs for v9 Update the redisotel example for v9 to match the example at https://redis.uptrace.dev/guide/go-redis-monitoring.html#what-is-opentelemetry. * docs: Point to correct otel example --- extra/redisotel/README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/extra/redisotel/README.md b/extra/redisotel/README.md index 44b5e207..997c17d1 100644 --- a/extra/redisotel/README.md +++ b/extra/redisotel/README.md @@ -18,9 +18,17 @@ import ( rdb := rdb.NewClient(&rdb.Options{...}) -rdb.AddHook(redisotel.NewTracingHook()) +// Enable tracing instrumentation. +if err := redisotel.InstrumentTracing(rdb); err != nil { + panic(err) +} + +// Enable metrics instrumentation. +if err := redisotel.InstrumentMetrics(rdb); err != nil { + panic(err) +} ``` -See [example](example) and +See [example](../../example/otel) and [Monitoring Go Redis Performance and Errors](https://redis.uptrace.dev/guide/go-redis-monitoring.html) for details.