Skip to content

Commit 53b3fd3

Browse files
nikolaydubinandyakov
authored andcommitted
Feature more prominently how to enable OpenTelemetry instrumentation (#3316)
1 parent b026cf8 commit 53b3fd3

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.github/wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Lua
2929
MSSQL
3030
namespace
3131
NoSQL
32+
OpenTelemetry
3233
ORM
3334
Packagist
3435
PhpRedis

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,24 @@ func ExampleClient() *redis.Client {
167167

168168
```
169169

170+
### Instrument with OpenTelemetry
171+
172+
```go
173+
import (
174+
"github.com/redis/go-redis/v9"
175+
"github.com/redis/go-redis/extra/redisotel/v9"
176+
"errors"
177+
)
178+
179+
func main() {
180+
...
181+
rdb := redis.NewClient(&redis.Options{...})
182+
183+
if err := errors.Join(redisotel.InstrumentTracing(rdb), redisotel.InstrumentMetrics(rdb)); err != nil {
184+
log.Fatal(err)
185+
}
186+
```
187+
170188
171189
### Advanced Configuration
172190

0 commit comments

Comments
 (0)