mirror of
https://github.com/redis/go-redis.git
synced 2025-04-17 20:17:02 +03:00
Feature more prominently how to enable OpenTelemetry instrumentation (#3316)
This commit is contained in:
parent
132818033b
commit
482a20d9c9
1
.github/wordlist.txt
vendored
1
.github/wordlist.txt
vendored
@ -29,6 +29,7 @@ Lua
|
|||||||
MSSQL
|
MSSQL
|
||||||
namespace
|
namespace
|
||||||
NoSQL
|
NoSQL
|
||||||
|
OpenTelemetry
|
||||||
ORM
|
ORM
|
||||||
Packagist
|
Packagist
|
||||||
PhpRedis
|
PhpRedis
|
||||||
|
18
README.md
18
README.md
@ -167,6 +167,24 @@ func ExampleClient() *redis.Client {
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Instrument with OpenTelemetry
|
||||||
|
|
||||||
|
```go
|
||||||
|
import (
|
||||||
|
"github.com/redis/go-redis/v9"
|
||||||
|
"github.com/redis/go-redis/extra/redisotel/v9"
|
||||||
|
"errors"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
...
|
||||||
|
rdb := redis.NewClient(&redis.Options{...})
|
||||||
|
|
||||||
|
if err := errors.Join(redisotel.InstrumentTracing(rdb), redisotel.InstrumentMetrics(rdb)); err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### Advanced Configuration
|
### Advanced Configuration
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user