|
3 | 3 | [](https://github.com/redis/go-redis/actions) |
4 | 4 | [](https://pkg.go.dev/github.com/redis/go-redis/v9?tab=doc) |
5 | 5 | [](https://redis.uptrace.dev/) |
| 6 | +[](https://goreportcard.com/report/github.com/redis/go-redis/v9) |
6 | 7 | [](https://codecov.io/github/redis/go-redis) |
7 | | -[](https://discord.gg/rWtp5Aj) |
| 8 | + |
| 9 | +[](https://discord.gg/W4txy5AeKM) |
| 10 | +[](https://www.twitch.tv/redisinc) |
| 11 | +[](https://www.youtube.com/redisinc) |
| 12 | +[](https://twitter.com/redisinc) |
| 13 | +[](https://stackoverflow.com/questions/tagged/go-redis) |
8 | 14 |
|
9 | 15 | > go-redis is the official Redis client library for the Go programming language. It offers a straightforward interface for interacting with Redis servers. |
10 | 16 |
|
@@ -44,7 +50,7 @@ in the `go.mod` to `go 1.24` in one of the next releases. |
44 | 50 | ## Resources |
45 | 51 |
|
46 | 52 | - [Discussions](https://github.com/redis/go-redis/discussions) |
47 | | -- [Chat](https://discord.gg/rWtp5Aj) |
| 53 | +- [Chat](https://discord.gg/W4txy5AeKM) |
48 | 54 | - [Reference](https://pkg.go.dev/github.com/redis/go-redis/v9) |
49 | 55 | - [Examples](https://pkg.go.dev/github.com/redis/go-redis/v9#pkg-examples) |
50 | 56 |
|
@@ -167,6 +173,24 @@ func ExampleClient() *redis.Client { |
167 | 173 |
|
168 | 174 | ``` |
169 | 175 |
|
| 176 | +### Instrument with OpenTelemetry |
| 177 | + |
| 178 | +```go |
| 179 | +import ( |
| 180 | + "github.com/redis/go-redis/v9" |
| 181 | + "github.com/redis/go-redis/extra/redisotel/v9" |
| 182 | + "errors" |
| 183 | +) |
| 184 | + |
| 185 | +func main() { |
| 186 | + ... |
| 187 | + rdb := redis.NewClient(&redis.Options{...}) |
| 188 | + |
| 189 | + if err := errors.Join(redisotel.InstrumentTracing(rdb), redisotel.InstrumentMetrics(rdb)); err != nil { |
| 190 | + log.Fatal(err) |
| 191 | + } |
| 192 | +``` |
| 193 | +
|
170 | 194 |
|
171 | 195 | ### Advanced Configuration |
172 | 196 |
|
@@ -215,9 +239,26 @@ val1 := client.FTSearchWithArgs(ctx, "txt", "foo bar", &redis.FTSearchOptions{}) |
215 | 239 |
|
216 | 240 | In the Redis-Search module, **the default dialect is 2**. If needed, you can explicitly specify a different dialect using the appropriate configuration in your queries. |
217 | 241 |
|
218 | | -## Contributing |
| 242 | +**Important**: Be aware that the query dialect may impact the results returned. If needed, you can revert to a different dialect version by passing the desired dialect in the arguments of the command you want to execute. |
| 243 | +For example: |
| 244 | +``` |
| 245 | + res2, err := rdb.FTSearchWithArgs(ctx, |
| 246 | + "idx:bicycle", |
| 247 | + "@pickup_zone:[CONTAINS $bike]", |
| 248 | + &redis.FTSearchOptions{ |
| 249 | + Params: map[string]interface{}{ |
| 250 | + "bike": "POINT(-0.1278 51.5074)", |
| 251 | + }, |
| 252 | + DialectVersion: 3, |
| 253 | + }, |
| 254 | + ).Result() |
| 255 | +``` |
| 256 | +You can find further details in the [query dialect documentation](https://redis.io/docs/latest/develop/interact/search-and-query/advanced-concepts/dialects/). |
219 | 257 |
|
220 | | -Please see [out contributing guidelines](CONTRIBUTING.md) to help us improve this library! |
| 258 | +## Contributing |
| 259 | +We welcome contributions to the go-redis library! If you have a bug fix, feature request, or improvement, please open an issue or pull request on GitHub. |
| 260 | +We appreciate your help in making go-redis better for everyone. |
| 261 | +If you are interested in contributing to the go-redis library, please check out our [contributing guidelines](CONTRIBUTING.md) for more information on how to get started. |
221 | 262 |
|
222 | 263 | ## Look and feel |
223 | 264 |
|
|
0 commit comments