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
This commit is contained in:
Kason Braley 2023-02-06 23:40:00 -07:00 committed by GitHub
parent fc26460b78
commit 74389af269
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -18,9 +18,17 @@ import (
rdb := rdb.NewClient(&rdb.Options{...}) 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) [Monitoring Go Redis Performance and Errors](https://redis.uptrace.dev/guide/go-redis-monitoring.html)
for details. for details.