File tree Expand file tree Collapse file tree 3 files changed +21
-16
lines changed
Expand file tree Collapse file tree 3 files changed +21
-16
lines changed Original file line number Diff line number Diff line change @@ -17,27 +17,32 @@ go get github.com/wzy9607/goredisotel
1717Tracing is enabled by adding a hook:
1818
1919``` go
20+ package main
21+
2022import (
21- " github.com/redis/go-redis/v9"
22- " github.com/wzy9607/goredisotel"
23+ redis " github.com/redis/go-redis/v9"
24+ " github.com/wzy9607/goredisotel"
2325)
2426
25- rdb := rdb.NewClient (&rdb.Options {...})
27+ func main () {
28+ rdb := redis.NewClient (&redis.Options {...})
2629
27- // Enable tracing and metrics instrumentation.
28- if err := goredisotel.InstrumentClientWithHooks (rdb); err != nil {
29- panic (err)
30- }
30+ // Enable tracing and metrics instrumentation.
31+ if err := goredisotel.InstrumentClientWithHooks (rdb); err != nil {
32+ panic (err)
33+ }
3134
32- // Enable tracing instrumentation only.
33- if err := goredisotel.InstrumentClientWithHooks (rdb, goredisotel.DisableMetrics ()); err != nil {
34- panic (err)
35- }
35+ // Enable tracing instrumentation only.
36+ if err := goredisotel.InstrumentClientWithHooks (rdb, goredisotel.DisableMetrics ()); err != nil {
37+ panic (err)
38+ }
3639
37- // Enable pool statistics metrics instrumentation.
38- if err := goredisotel.InstrumentPoolStatsMetrics (rdb); err != nil {
39- panic (err)
40+ // Enable pool statistics metrics instrumentation.
41+ if err := goredisotel.InstrumentPoolStatsMetrics (rdb); err != nil {
42+ panic (err)
43+ }
4044}
45+
4146```
4247
4348See [ example] ( ./example )
Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ func (ch *clientHook) ProcessPipelineHook(hook redis.ProcessPipelineHook) redis.
211211 if ch .conf .dbQueryTextEnabled {
212212 attrs = append (attrs , semconv .DBQueryText (cmdsString ))
213213 }
214- // db.stored_procedure.name is not added for now,
214+ // todo db.stored_procedure.name is not added for now,
215215 // because it requires to check that all commands are the same stored procedure.
216216
217217 opts := ch .spanOpts
Original file line number Diff line number Diff line change @@ -2,5 +2,5 @@ package redisotel
22
33const (
44 instrumName = "github.com/wzy9607/goredisotel"
5- version = "v0.3.1 "
5+ version = "v0.4.0 "
66)
You can’t perform that action at this time.
0 commit comments