Skip to content

Commit d187b59

Browse files
authored
release v0.4.0 (#60)
1 parent f6559f7 commit d187b59

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

README.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,32 @@ go get github.com/wzy9607/goredisotel
1717
Tracing is enabled by adding a hook:
1818

1919
```go
20+
package main
21+
2022
import (
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

4348
See [example](./example)

hook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

meta.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ package redisotel
22

33
const (
44
instrumName = "github.com/wzy9607/goredisotel"
5-
version = "v0.3.1"
5+
version = "v0.4.0"
66
)

0 commit comments

Comments
 (0)