Commit 2a0c044
authored
[receiver/redisreceiver] Add support for Redis sentinel information (#42401)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Add support for exposing Redis sentinel and mode metrics.
Redis Sentinel metrics with Redis mode:
```sh
# HELP redis_mode Redis server mode
# TYPE redis_mode gauge
redis_mode{mode="sentinel",otel_scope_name="github.com/open-telemetry/opentelemetry-collector-contrib/receiver/redisreceiver",otel_scope_schema_url="",otel_scope_version="0.134.0-dev"} 1
# HELP redis_sentinel_masters Number of masters monitored by Sentinel.
# TYPE redis_sentinel_masters gauge
redis_sentinel_masters{otel_scope_name="github.com/open-telemetry/opentelemetry-collector-contrib/receiver/redisreceiver",otel_scope_schema_url="",otel_scope_version="0.134.0-dev"} 1
# HELP redis_sentinel_running_scripts Number of running Sentinel scripts.
# TYPE redis_sentinel_running_scripts gauge
redis_sentinel_running_scripts{otel_scope_name="github.com/open-telemetry/opentelemetry-collector-contrib/receiver/redisreceiver",otel_scope_schema_url="",otel_scope_version="0.134.0-dev"} 0
# HELP redis_sentinel_scripts_queue_length Length of Sentinel scripts queue.
# TYPE redis_sentinel_scripts_queue_length gauge
redis_sentinel_scripts_queue_length{otel_scope_name="github.com/open-telemetry/opentelemetry-collector-contrib/receiver/redisreceiver",otel_scope_schema_url="",otel_scope_version="0.134.0-dev"} 0
# HELP redis_sentinel_simulate_failure_flags Simulated failure flags bitmask.
# TYPE redis_sentinel_simulate_failure_flags gauge
redis_sentinel_simulate_failure_flags{otel_scope_name="github.com/open-telemetry/opentelemetry-collector-contrib/receiver/redisreceiver",otel_scope_schema_url="",otel_scope_version="0.134.0-dev"} 0
# HELP redis_sentinel_tilt Whether Sentinel is in TILT mode (1 = tilt, 0 = normal).
# TYPE redis_sentinel_tilt gauge
redis_sentinel_tilt{otel_scope_name="github.com/open-telemetry/opentelemetry-collector-contrib/receiver/redisreceiver",otel_scope_schema_url="",otel_scope_version="0.134.0-dev"} 0
# HELP redis_sentinel_tilt_since_seconds Duration in seconds of current TILT, or -1 if not in TILT mode.
# TYPE redis_sentinel_tilt_since_seconds gauge
redis_sentinel_tilt_since_seconds{otel_scope_name="github.com/open-telemetry/opentelemetry-collector-contrib/receiver/redisreceiver",otel_scope_schema_url="",otel_scope_version="0.134.0-dev"} -1
# HELP redis_sentinel_tilt_total Total TILT occurrences since start.
# TYPE redis_sentinel_tilt_total counter
redis_sentinel_tilt_total{otel_scope_name="github.com/open-telemetry/opentelemetry-collector-contrib/receiver/redisreceiver",otel_scope_schema_url="",otel_scope_version="0.134.0-dev"} 0
```
Redis mode (standalone):
```sh
# HELP redis_mode Redis server mode
# TYPE redis_mode gauge
redis_mode{mode="standalone",otel_scope_name="github.com/open-telemetry/opentelemetry-collector-contrib/receiver/redisreceiver",otel_scope_schema_url="",otel_scope_version="0.134.0-dev"} 1
```
Redis mode (cluster):
```sh
# HELP redis_mode Redis server mode
# TYPE redis_mode gauge
redis_mode{mode="cluster",otel_scope_name="github.com/open-telemetry/opentelemetry-collector-contrib/receiver/redisreceiver",otel_scope_schema_url="",otel_scope_version="0.134.0-dev"} 1
```
<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes #42365
<!--Describe what testing was performed and which tests were added.-->
#### Testing
I tested this against all the possible modes (sentinel, standalone, and
cluster). The sentinel metrics are only evaluated and exposed when
`redis_mode:sentinel`.
I also added integration tests `TestIntegrationV8Sentinel` for the
`sentinel` mode.
<!--Describe the documentation added.-->
#### Documentation
Updated the documentation using `mdatagen`
<!--Please delete paragraphs that you did not use before submitting.-->
---------
Signed-off-by: Paulo Dias <[email protected]>1 parent 9a21c47 commit 2a0c044
File tree
12 files changed
+1194
-6
lines changed- .chloggen
- receiver/redisreceiver
- internal/metadata
- testdata
- testdata/integration
12 files changed
+1194
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
458 | 472 | | |
459 | 473 | | |
460 | 474 | | |
| |||
477 | 491 | | |
478 | 492 | | |
479 | 493 | | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
480 | 542 | | |
481 | 543 | | |
482 | 544 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| 44 | + | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
| |||
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
| 91 | + | |
| 92 | + | |
86 | 93 | | |
87 | 94 | | |
88 | 95 | | |
| |||
91 | 98 | | |
92 | 99 | | |
93 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments