Skip to content

Commit 63df0e5

Browse files
monkey92tvmihailencoericmillinheyanfu
authored
sync master (#1800)
* Remove OpenTelemetry from the code (but leave redisotel as is) (#1782) * Add XAutoClaim command (#1780) * fix typo (#1788) * xgroup/xadd/xtrim supports new options (#1787) * support cmd option XGROUP CREATECONSUMER XTRIM MINID LIMIT XADD NOMKSTREAM MINID LIMIT Signed-off-by: monkey <[email protected]> * add XAddArgs.Approx doc Signed-off-by: monkey92t <[email protected]> * Add Bun to readme * Upgrade the <sorted set> series of commands (#1792) * Upgrade the <sorted set> series of commands Signed-off-by: monkey92t <[email protected]> * Cancel the Deprecated mark of ZAddNX and ZAddXX Signed-off-by: monkey92t <[email protected]> * Explain the use restrictions of KeepTTL. (#1799) Signed-off-by: monkey92t <[email protected]> * Adjust KeepTTL annotation. Signed-off-by: monkey92t <[email protected]> * the hello command throws possible errors, It may affect the "read timeout" test result. Signed-off-by: monkey92t <[email protected]> Co-authored-by: Vladimir Mihailenco <[email protected]> Co-authored-by: ericmillin <[email protected]> Co-authored-by: heyanfu <[email protected]>
1 parent bd6402a commit 63df0e5

File tree

13 files changed

+948
-449
lines changed

13 files changed

+948
-449
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
> :heart:
44
> [**Uptrace.dev** - All-in-one tool to optimize performance and monitor errors & logs](https://uptrace.dev)
55
6+
## v8.10
7+
8+
- Removed extra OpenTelemetry spans from go-redis core. Now go-redis instrumentation only adds a
9+
single span with a Redis command (instead of 4 spans). There are multiple reasons behind this
10+
decision:
11+
12+
- Traces become smaller and less noisy.
13+
- It may be costly to process those 3 extra spans for each query.
14+
- go-redis no longer depends on OpenTelemetry.
15+
16+
Eventually we hope to replace the information that we no longer collect with OpenTelemetry
17+
Metrics.
18+
619
## v8.9
720

821
- Changed `PubSub.Channel` to only rely on `Ping` result. You can now use `WithChannelSize`,

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
- [Examples](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#pkg-examples)
1818
- [RealWorld example app](https://github.com/uptrace/go-treemux-realworld-example-app)
1919

20+
> :heart: Please check [Bun](https://bun.uptrace.dev) - fast and simple SQL client for PostgreSQL,
21+
> MySQL, and SQLite.
22+
2023
## Ecosystem
2124

2225
- [Redis Mock](https://github.com/go-redis/redismock).
@@ -160,8 +163,3 @@ Lastly, run:
160163
```
161164
go test
162165
```
163-
164-
## See also
165-
166-
- [Fast and flexible ORM](https://github.com/uptrace/bun)
167-
- [msgpack for Go](https://github.com/vmihailenco/msgpack)

bench_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func BenchmarkZAdd(b *testing.B) {
222222

223223
b.RunParallel(func(pb *testing.PB) {
224224
for pb.Next() {
225-
err := client.ZAdd(ctx, "key", &redis.Z{
225+
err := client.ZAdd(ctx, "key", redis.Z{
226226
Score: float64(1),
227227
Member: "hello",
228228
}).Err()

command.go

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,112 @@ func (cmd *XPendingExtCmd) readReply(rd *proto.Reader) error {
15091509

15101510
//------------------------------------------------------------------------------
15111511

1512+
type XAutoClaimCmd struct {
1513+
baseCmd
1514+
1515+
start string
1516+
val []XMessage
1517+
}
1518+
1519+
var _ Cmder = (*XAutoClaimCmd)(nil)
1520+
1521+
func NewXAutoClaimCmd(ctx context.Context, args ...interface{}) *XAutoClaimCmd {
1522+
return &XAutoClaimCmd{
1523+
baseCmd: baseCmd{
1524+
ctx: ctx,
1525+
args: args,
1526+
},
1527+
}
1528+
}
1529+
1530+
func (cmd *XAutoClaimCmd) Val() (messages []XMessage, start string) {
1531+
return cmd.val, cmd.start
1532+
}
1533+
1534+
func (cmd *XAutoClaimCmd) Result() (messages []XMessage, start string, err error) {
1535+
return cmd.val, cmd.start, cmd.err
1536+
}
1537+
1538+
func (cmd *XAutoClaimCmd) String() string {
1539+
return cmdString(cmd, cmd.val)
1540+
}
1541+
1542+
func (cmd *XAutoClaimCmd) readReply(rd *proto.Reader) error {
1543+
var err error
1544+
if err = rd.ReadFixedArrayLen(2); err != nil {
1545+
return err
1546+
}
1547+
1548+
cmd.start, err = rd.ReadString()
1549+
if err != nil {
1550+
return err
1551+
}
1552+
cmd.val, err = readXMessageSlice(rd)
1553+
if err != nil {
1554+
return err
1555+
}
1556+
return nil
1557+
}
1558+
1559+
//------------------------------------------------------------------------------
1560+
1561+
type XAutoClaimJustIDCmd struct {
1562+
baseCmd
1563+
1564+
start string
1565+
val []string
1566+
}
1567+
1568+
var _ Cmder = (*XAutoClaimJustIDCmd)(nil)
1569+
1570+
func NewXAutoClaimJustIDCmd(ctx context.Context, args ...interface{}) *XAutoClaimJustIDCmd {
1571+
return &XAutoClaimJustIDCmd{
1572+
baseCmd: baseCmd{
1573+
ctx: ctx,
1574+
args: args,
1575+
},
1576+
}
1577+
}
1578+
1579+
func (cmd *XAutoClaimJustIDCmd) Val() (ids []string, start string) {
1580+
return cmd.val, cmd.start
1581+
}
1582+
1583+
func (cmd *XAutoClaimJustIDCmd) Result() (ids []string, start string, err error) {
1584+
return cmd.val, cmd.start, cmd.err
1585+
}
1586+
1587+
func (cmd *XAutoClaimJustIDCmd) String() string {
1588+
return cmdString(cmd, cmd.val)
1589+
}
1590+
1591+
func (cmd *XAutoClaimJustIDCmd) readReply(rd *proto.Reader) error {
1592+
var err error
1593+
if err = rd.ReadFixedArrayLen(2); err != nil {
1594+
return err
1595+
}
1596+
1597+
cmd.start, err = rd.ReadString()
1598+
if err != nil {
1599+
return err
1600+
}
1601+
n, err := rd.ReadArrayLen()
1602+
if err != nil {
1603+
return err
1604+
}
1605+
1606+
cmd.val = make([]string, n)
1607+
for i := 0; i < n; i++ {
1608+
cmd.val[i], err = rd.ReadString()
1609+
if err != nil {
1610+
return err
1611+
}
1612+
}
1613+
return nil
1614+
}
1615+
1616+
//------------------------------------------------------------------------------
1617+
15121618
type XInfoConsumersCmd struct {
15131619
baseCmd
15141620
val []XInfoConsumer

0 commit comments

Comments
 (0)