mirror of
				https://github.com/redis/go-redis.git
				synced 2025-11-04 02:33:24 +03:00 
			
		
		
		
	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:
		@@ -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.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user