1
0
mirror of https://github.com/redis/go-redis.git synced 2025-06-05 06:42:39 +03:00

Feature more prominently how to enable OpenTelemetry instrumentation (#3316)

This commit is contained in:
Nikolay Dubina 2025-03-25 15:28:25 +08:00 committed by Nedyalko Dyakov
parent b026cf813b
commit 53b3fd3e76
No known key found for this signature in database
GPG Key ID: 5571106A08EA25A3
2 changed files with 19 additions and 0 deletions

View File

@ -29,6 +29,7 @@ Lua
MSSQL
namespace
NoSQL
OpenTelemetry
ORM
Packagist
PhpRedis

View File

@ -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