Commit Graph
156 Commits
Author SHA1 Message Date
BigskandGitHub cd984fae99 chore(ring): inline rendezvous hashing and remove external dependency (#3762)
* ring: remove external rendezvous dependency by inlining implementation

Replace usage of github.com/dgryski/go-rendezvous with an internal
implementation to eliminate the external dependency and avoid licence
propagation concerns.

The implementation preserves the exact hashing algorithm and behaviour:
- same hash combination: khash ^ nhash
- same mixing function (xorshift* variant)
- same node ordering semantics

No functional changes intended.

* Refactor TestRendezvous to remove randomString function

Replaced function with inline string generation for test cases.

* test: refactor RendezvousHash tests to use Ginkgo and Gomega

* test: improve RendezvousHash test for per-instance determinism and distribution balance

* test: enhance distribution verification in RendezvousHash tests
2026-04-07 10:26:18 +03:00
Jesse BankandGitHub e79b6eb07f feat(otel): Fixing cluster metrics attributes slice corruption (#3699) 2026-03-23 18:13:48 +02:00
dependabot[bot]andGitHub 427077933d chore(deps): bump go.opentelemetry.io/otel/sdk in /extra/redisotel (#3745) 2026-03-22 16:03:06 +02:00
ofekshenawaandGitHub cd3949d1a0 fix: connection closure metrics and enable all metric groups by default (#3735)
* fix: connection closure metrics and enable all metric groups by default

This commit addresses three issues in the redisotel-native metrics implementation:

1. Fix connection closure metrics not appearing in dashboards
   - Root cause: CloseConn() in internal/pool/pool.go was not calling
     the metricConnectionClosedCallback when closing stale connections
   - Added callback invocation in CloseConn() to record 'stale' closures

2. Verify tracing and metrics compatibility
   - Added TestTracingAndMetricsCompatibility to document that
     redisotel (tracing via AddHook) and redisotel-native (metrics via
     SetOTelRecorder) can coexist without conflicts

3. Enable all metric groups by default
   - Changed default MetricGroups from connection-basic+resiliency
     to MetricGroupAll for comprehensive observability out of the box
2026-03-16 09:54:24 +02:00
903b0811b8 fix(redisotel-native): use metric definition from otel/semconv/v1.38.0 (#3731)
Uses the name, desc, unit of `db.client.operation.duration`, `db.client.connection.count`, `db.client.connection.create_time`, `db.client.connection.wait_time`, `db.client.connection.pending_requests` defined by otel/semconv/v1.38.0/dbconv.
The resolves the metric description part of #3730.

Co-authored-by: ofekshenawa <[email protected]>
2026-03-12 09:49:39 +02:00
8eca179665 feat(command): Implement ReplicaOf method to replace deprecated SlaveOf (#3720)
* Initial plan

* Implement ReplicaOf method and update test usages

Co-authored-by: ndyakov <[email protected]>

* Run go fmt on modified files

Co-authored-by: ndyakov <[email protected]>

* Final review completed

Co-authored-by: ndyakov <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: ndyakov <[email protected]>
Co-authored-by: ofekshenawa <[email protected]>
2026-03-09 13:35:16 +02:00
Nedyalko DyakovandGitHub 3b155e9443 chore(go): update go version to 1.24 (#3714)
* chore(go): update go version to 1.24

* update readmes and ci workflows

* update dockerfile for proxy-fi-server

* address changed test behaviour

* address changed test behaviour
2026-02-20 10:00:33 +02:00
Nedyalko DyakovandGitHub 90faf06923 chore(release): update versions in deps (#3712) 2026-02-16 16:41:48 +02:00
Nedyalko DyakovandGitHub bf8e8e3b16 chore(release): v9.18.0 (#3711)
* chore(release): add release notes

* chore(release): update version
2026-02-16 16:19:35 +02:00
a881cd4280 fix(clone): nil pointer dereference in PubSub after WithTimeout() (#3710)
* Initial plan

* Fix pubSubPool nil pointer in clone() method

Co-authored-by: ndyakov <[email protected]>

* Final: Fix complete and verified

Co-authored-by: ndyakov <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: ndyakov <[email protected]>
2026-02-16 10:44:37 +02:00
ee6e9dbf09 feat(otel): Add OpenTelemetry Native Metrics Support (#3637)
* First draft. One metric - command duration.

Signed-off-by: Elena Kolevska <[email protected]>

* Adds connection state metrics

Signed-off-by: Elena Kolevska <[email protected]>

* wip

Signed-off-by: Elena Kolevska <[email protected]>

* Add phase 1 metrics

* Add client api configurations

* remove redundent code

* refactor: move otel-metrics example to separate module

* refactor: move otel-metrics example to separate module

* remove internal test

* Resolve merge conflicts with upstream/master

* Fix linting issues

* Fix pool idle connection counter bug

* Add OTel performance benchmarking suite

* Improve perf compatison script

* Add phase 2,3 metrics

* Remove local benchmark tests

* Add new fields to tests

* Change db.client.connection.count and db.client.connection.pending_request metric type from UpAndDownCounter to Async gauge.

* fix golangci lint

* Add piplined commands metrics support

* Redesign otel init method

* Address comments

* Fix golangci-lint errors

* Fix passing nil pointer

* Add metric prefix to callbacks and atomic batch registration

* Add unique name for pool.name attr

* Fix unique pool name for pubsub

* Refactor all hardcoded OTel attribute strings to use constants

* Refactor all hardcoded OTel attribute strings to use constants

* extract metric names and pool names as constants, improve error handling

---------

Signed-off-by: Elena Kolevska <[email protected]>
Co-authored-by: Elena Kolevska <[email protected]>
2026-02-13 18:08:10 +02:00
2b8d05ed37 chore(fmt): proper formatting (#3670)
* all: proper formatting

* .golangci.yml: add linter for format check

* ran `golangci-lint fmt`

---------

Co-authored-by: Nedyalko Dyakov <[email protected]>
2026-01-13 14:48:02 +02:00
6a928301d0 fix(rediscmd): include space in simple byte range (#3204) (#3659)
* fix(rediscmd): include space in simple byte range (#3204)

* add space test

---------

Co-authored-by: fumiyanokesinn <[email protected]>
Co-authored-by: Nedyalko Dyakov <[email protected]>
2026-01-08 17:44:02 +02:00
Nedyalko DyakovandGitHub e4965ea90b chore(release) v9.18.0-beta.2 (#3644)
* add release notes

* update version number

* update date
2025-12-09 15:50:10 +02:00
674c7b8695 chore(go): update go version to 1.21 (#3640)
* chore(go): update go version to 1.21

* chore(aggregators): make aggregators work with 1.21

* fix doctests

* address copilot comments

* use atomic bool for logic and/or aggregators

* Update .github/workflows/build.yml

Co-authored-by: ccoVeille <[email protected]>

* use stable/oldstable, 1.23 and 1.21

* fix versions in README

* add oldstable in wordlist

---------

Co-authored-by: ccoVeille <[email protected]>
2025-12-05 12:27:55 +02:00
fengweiandGitHub e2153f5c16 feat(otel): categorize metrics with nil response (#3638)
* Remove metrics with empty data

Because empty data cannot be considered an error.

* redis.Nil uses a separate state.

Better differentiation between values, null values, and errors.
2025-12-03 16:41:44 +02:00
ofekshenawaandGitHub 7a345ab467 Revert PR #3634 (Observability metrics phase1) (#3635) 2025-12-03 10:24:05 +02:00
Elena Kolevskaandofekshenawa 2a7725db63 Adds connection state metrics
Signed-off-by: Elena Kolevska <[email protected]>
2025-12-03 10:01:53 +02:00
Elena Kolevskaandofekshenawa d588c3ca71 First draft. One metric - command duration.
Signed-off-by: Elena Kolevska <[email protected]>
2025-12-03 10:00:09 +02:00
Nedyalko DyakovandGitHub 981f5db9a2 chore(release): 9.18.0-beta.1 (#3628)
* bump version to 9.18.0-beta.1

* add release notes
2025-12-02 15:08:54 +02:00
f711eb0f62 feat(cluster): Implement Request and Response Policy Based Routing in Cluster Mode (#3422)
* Add search module builders and tests (#1)

* Add search module builders and tests

* Add tests

* Use builders and Actions in more clean way

* Update search_builders.go

Co-authored-by: Nedyalko Dyakov <[email protected]>

* Update search_builders.go

Co-authored-by: Nedyalko Dyakov <[email protected]>

* Apply suggestions from code review

Co-authored-by: Nedyalko Dyakov <[email protected]>

* feat(routing): add internal request/response policy enums

* feat: load the policy table in cluster client (#4)

* feat: load the policy table in cluster client

* Remove comments

* modify Tips and command pplicy in commandInfo (#5)

* centralize cluster command routing in osscluster_router.go and refactor osscluster.go (#6)

* centralize cluster command routing in osscluster_router.go and refactor osscluster.go

* enalbe ci on all branches

* Add debug prints

* Add debug prints

* FIX: deal with nil policy

* FIX: fixing clusterClient process

* chore(osscluster): simplify switch case

* wip(command): ai generated clone method for commands

* feat: implement response aggregator for Redis cluster commands

* feat: implement response aggregator for Redis cluster commands

* fix: solve concurrency errors

* fix: solve concurrency errors

* return MaxRedirects settings

* remove locks from getCommandPolicy

* Handle MOVED errors more robustly, remove cluster reloading at exectutions, ennsure better routing

* Fix: supports Process hook test

* Fix: remove response aggregation for single shard commands

* Add more preformant type conversion for Cmd type

* Add router logic into processPipeline

---------

Co-authored-by: Nedyalko Dyakov <[email protected]>

* remove thread debugging code

* remove thread debugging code && reject commands with policy that cannot be used in pipeline

* refactor processPipline and cmdType enum

* remove FDescribe from cluster tests

* Add tests

* fix aggregation test

* fix mget test

* fix mget test

* remove aggregateKeyedResponses

* added scaffolding for the req-resp manager

* added default policies for the search commands

* split command map into module->command

* cleanup, added logic to refresh the cache

* added reactive cache refresh

* revert cluster refresh

* fixed lint

* addresed first batch of comments

* rewrote aggregator implementations with atomic for native or nearnative primitives

* addressed more comments, fixed lint

* added batch aggregator operations

* fixed lint

* updated batch aggregator, fixed extractcommandvalue

* fixed lint

* added batching to aggregateResponses

* fixed deadlocks

* changed aggregator logic, added error params

* added preemptive return to the aggregators

* more work on the aggregators

* updated and and or aggregators

* fixed lint

* added configurable policy resolvers

* slight refactor

* removed the interface, slight refactor

* change func signature from cmdName to cmder

* added nil safety assertions

* few small refactors

* added read only policies

* removed leftover prints

* Rebased to master, resolved comnflicts

* fixed lint

* updated gha

* fixed tests, minor consistency refactor

* preallocated simple errors

* changed numeric aggregators to use float64

* speculative test fix

* Update command.go

Co-authored-by: Nedyalko Dyakov <[email protected]>

* Update main_test.go

Co-authored-by: Nedyalko Dyakov <[email protected]>

* Add static shard picker

* Fix nil value handling in command aggregation

* Modify the Clone method to return a shallow copy

* Add clone method to digest command

* Optimize keyless command routing to respect ShardPicker policy

* Remove MGET references

* Fix MGET aggregation to map individual values to keys across shards

* Add clone method to hybrid search commands

* Undo changes in route keyless test

* remove comments

* Add test for DisableRoutingPolicies option

* Add Routing Policies Comprehensive Test Suite and Fix multi keyed aggregation for different step

---------

Co-authored-by: Nedyalko Dyakov <[email protected]>
Co-authored-by: Nedyalko Dyakov <[email protected]>
Co-authored-by: Hristo Temelski <[email protected]>
2025-11-28 11:46:23 +02:00
Nedyalko DyakovandGitHub 68d8c59557 chore(release): v9.17.1 (#3617)
* add release notes

* update version to 9.17.1
2025-11-26 12:20:20 +02:00
Nedyalko DyakovandGitHub 5b0b228a37 chore(release): v9.17.0 (#3604)
* update release notes

* update readme

* update version number

* cleanup release notes

* fix checkMinIdle
2025-11-19 19:53:02 +02:00
284d93a4b3 feat(cmd): Add support for MSetEX command (#3580)
Co-authored-by: Nedyalko Dyakov <[email protected]>
2025-11-05 13:35:43 +02:00
7f48276660 feat(otel): Add a 'error_type' metrics attribute to separate context errors (#3566)
Co-authored-by: vragov_pf <[email protected]>
2025-10-29 16:09:12 +02:00
Nedyalko DyakovandGitHub f1956565ee chore(release): 9.16.0 (#3557)
* notes

* bump version
2025-10-23 18:08:39 +03:00
70dfa383fe feat(otel): add trace filter for process pipeline and dial operation (#3550)
* feat(tracing): add process pipeline and dial filtering options for tracing

* refactor(tracing): implement default command filter and process pipeline options

* refactor(tracing): rename defaultCommandFilter to DefaultCommandFilter

* refactor(tracing): add BasicCommandFilter as a deprecated alias for DefaultCommandFilter

---------

Co-authored-by: Nedyalko Dyakov <[email protected]>
2025-10-22 12:57:15 +03:00
Warnar BoekkooiandGitHub 8ca21d2600 chore(redisotel): use metric.WithAttributeSet to avoid copy (#3552)
In order to improve performance replace `WithAttributes` with `WithAttributeSet`.
This avoids the slice allocation and copy that is done in `WithAttributes`.

For more information see https://github.com/open-telemetry/opentelemetry-go/blob/v1.38.0/metric/instrument.go#L357-L376
2025-10-21 14:56:06 +03:00
7aa4a60667 update gomods to align them with the latest beta (#3539)
Co-authored-by: Nedyalko Dyakov <[email protected]>
2025-10-21 11:28:04 +03:00
f7eed76fbc Add support for filtering traces for certain commands (#3519)
* Add support for filtering commands when tracing

Signed-off-by: Jason Parraga <[email protected]>

* Filter sensitive data by default

Signed-off-by: Jason Parraga <[email protected]>

* Address comments

Signed-off-by: Jason Parraga <[email protected]>

---------

Signed-off-by: Jason Parraga <[email protected]>
Co-authored-by: Nedyalko Dyakov <[email protected]>
2025-10-14 18:15:58 +03:00
Hristo TemelskiandGitHub a44df88257 version 9.15.1, used to retract itself and 9.15.0 (#3537)
* version 9.15.1, used to retract itself and 9.15.0

* added retract to the submodules

* revert submodules retracts as they are not needed
2025-09-27 23:33:54 +03:00
Hristo TemelskiandGitHub 819f01b489 retract wrongly released version (#3533) 2025-09-27 15:38:46 +01:00
Hristo TemelskiandGitHub 7405cff430 depreciate 9.15.0 (#3532) 2025-09-27 02:17:21 +03:00
Hristo TemelskiandGitHub 8b38e27f97 release: 9.15.0-beta.2 (#3531) 2025-09-26 19:40:07 +03:00
Nedyalko DyakovandGitHub 0dcfeefea7 chore(release): 9.15.0-beta.1 (#3514) 2025-09-10 23:02:16 +03:00
Hristo TemelskiandGitHub 2da6ca07c0 chore(release): Update the rest of the versions (#3513)
* chore(release): Update the rest of the versions

* improved tag script
2025-09-10 15:01:18 +03:00
Hristo TemelskiandGitHub c11a704481 chore(release): v9.14.0 (#3512) 2025-09-10 14:33:08 +03:00
Nedyalko DyakovandGitHub 52bda7a35a chore(release): 9.13.0 (#3500) 2025-09-03 14:52:32 +03:00
Matthew HookerandGitHub 19fdc488a7 chore(otel): register wait metrics (#3499) 2025-09-03 13:12:41 +03:00
Matthew HookerandGitHub f0058063a9 feat(otel): Add wait metrics to otel (#3493)
* Add wait metrics to otel

* add unit
2025-09-02 15:48:18 +03:00
Hristo TemelskiandGitHub 6220024a38 chore(otel): Update otel metrics URL (#3474) 2025-08-12 14:07:17 +03:00
Nedyalko DyakovandGitHub 7b4a537aef chore(release): 9.12.1, failover client buffer size fixes (#3469) 2025-08-11 18:58:21 +03:00
Nedyalko DyakovandGitHub b7838dc4e7 chore(release): 9.12.0 / redis 8.2 (#3464) 2025-08-05 16:50:25 +03:00
4767d9dfaf fix(redisotel): fix buggy append in reportPoolStats (#3122)
The current append twice to `conf.attrs` approach in `reportPoolStats` may result in unexpected idleAttrs,
due to `append` [can mutate](https://github.com/golang/go/issues/29115#issuecomment-444669036) the underlying array of the original slice,
as demonstrated at <https://go.dev/play/p/jwRMofH91eQ?v=goprev>.

Also, I replaced `metric.WithAttributes` in `reportPoolStats` with `metric.WithAttributeSet`,
since `WithAttributes` is just `WithAttributeSet` with some extra works that are not needed here,
see <https://pkg.go.dev/go.opentelemetry.io/otel/[email protected]#WithAttributes>.

Co-authored-by: Nedyalko Dyakov <[email protected]>
2025-08-05 15:15:34 +03:00
Nedyalko DyakovandGitHub f006e941d9 chore(release): 9.12.0-beta.1 (#3460) 2025-08-04 15:00:37 +03:00
Antonio MindovandGitHub 23a87a2137 feat(otel): add closing support to otel metrics instrumentation (#3444)
closes #3424
2025-07-24 12:48:34 +03:00
Nedyalko DyakovandGitHub 0decfdc6ed chore(release): v9.11.0 (#3416)
* chore(release): update version to 9.11.0

* chore(release): Add Release Notes for v9.11.0
2025-06-24 14:05:24 +03:00
fa475cbc99 feat(redisotel): add WithCallerEnabled option (#3415)
* feat(redisotel): add WithCaller option

Allow the disabling the collection of the `code.function`, `code.filepath` and `code.lineno` tracing attributes.
When setting `WithCaller(false)` overall performance is increased as the "expensive" `runtime.Callers` and `runtime.(*Frames).Next` calls are no longer needed.

* chore(redisotel): improve docblock language

* chore(redisotel): rename `WithCaller` to `WithCallerEnabled`

---------

Co-authored-by: Nedyalko Dyakov <[email protected]>
2025-06-24 10:53:35 +03:00
Nedyalko DyakovandGitHub 75e8370a6f chore(release): Update release notes and versions for v9.10.0 (#3395) 2025-06-06 18:30:30 +03:00
Nedyalko DyakovandGitHub c935f96148 release(go-redis): v9.9.0 (#3390)
* release(go-redis): v9.9.0

- Add release notes
- Update dependencies and version.go

* chore(release-notes) Update release notes
2025-05-27 19:00:07 +03:00