Skip to content

Commit 71dbe37

Browse files
authored
more batching to improve checkkeys latency, new memory usage metrics (#987)
* more aggressive command batching to reduce roundtrips and improve scrape duration when exporter-to-instance latency is high. * update README, add that checkKeys doesn't work in cluster mode because SCAN does not work across multiple instances
1 parent 9ecfaef commit 71dbe37

File tree

12 files changed

+607
-408
lines changed

12 files changed

+607
-408
lines changed

.github/workflows/tests.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ jobs:
4949
LOG_LEVEL: "info"
5050
run: |
5151
sleep 15
52-
make checks
5352
make test
5453
5554
@@ -102,6 +101,12 @@ jobs:
102101
version: v1.64
103102
args: "--tests=false"
104103

104+
- name: Run checks
105+
env:
106+
LOG_LEVEL: "info"
107+
run: |
108+
make checks
109+
105110
106111
build-stuff:
107112
runs-on: ubuntu-latest

README.md

Lines changed: 45 additions & 45 deletions
Large diffs are not rendered by default.

docker-compose.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,11 @@ services:
8989

9090
redis-cluster:
9191
image: grokzen/redis-cluster:6.2.14
92+
environment:
93+
- IP=0.0.0.0
9294
ports:
93-
- "7000"
94-
- "7001"
95-
- "7002"
96-
- "7003"
97-
- "7004"
98-
- "7005"
99-
- "17000:7000"
100-
- "17005:7005"
95+
- 7000-7005:7000-7005
96+
- 17000-17005:7000-7005
10197

10298
redis-cluster-password:
10399
image: bitnami/redis-cluster:7.4

exporter/exporter.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ type Exporter struct {
2727
sync.Mutex
2828

2929
redisAddr string
30-
namespace string
3130

3231
totalScrapes prometheus.Counter
3332
scrapeDuration prometheus.Summary
@@ -103,7 +102,6 @@ func NewRedisExporter(uri string, opts Options) (*Exporter, error) {
103102
e := &Exporter{
104103
redisAddr: uri,
105104
options: opts,
106-
namespace: opts.Namespace,
107105

108106
buildInfo: opts.BuildInfo,
109107

@@ -433,6 +431,7 @@ func NewRedisExporter(uri string, opts Options) (*Exporter, error) {
433431
"key_size": {txt: `The length or size of "key"`, lbls: []string{"db", "key"}},
434432
"key_value": {txt: `The value of "key"`, lbls: []string{"db", "key"}},
435433
"key_value_as_string": {txt: `The value of "key" as a string`, lbls: []string{"db", "key", "val"}},
434+
"key_memory_usage_bytes": {txt: `The memory usage of "key" in bytes`, lbls: []string{"db", "key"}},
436435
"keys_count": {txt: `Count of keys`, lbls: []string{"db", "key"}},
437436
"last_key_groups_scrape_duration_milliseconds": {txt: `Duration of the last key group metrics scrape in milliseconds`},
438437
"last_slow_execution_duration_seconds": {txt: `The amount of time needed for last slow execution, in seconds`},

0 commit comments

Comments
 (0)