-
Notifications
You must be signed in to change notification settings - Fork 527
[Redis] Add and update metrics fields for Redis 7.x and 8.x #16732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
giorgi-imerlishvili-elastic
wants to merge
7
commits into
elastic:main
Choose a base branch
from
giorgi-imerlishvili-elastic:redis-package-update-and-sys-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7aa1577
add new fields for Redis 7.x and 8.x to info datastream
giorgi-imerlishvili-elastic 38c78e1
add system test for info data stream
giorgi-imerlishvili-elastic d1c8f74
changelog
giorgi-imerlishvili-elastic 2399205
add system tests for key and keyspace data streams
giorgi-imerlishvili-elastic 9b0f076
fix key data stream test
giorgi-imerlishvili-elastic d6a3fd5
update sample event files
giorgi-imerlishvili-elastic e963ba8
Add default value to SERVICE_VERSION for Dockerfile build
giorgi-imerlishvili-elastic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| ARG SERVICE_VERSION | ||
| FROM redis:${SERVICE_VERSION}-alpine | ||
| HEALTHCHECK --interval=1s --retries=90 CMD nc -z localhost 6379 | ||
|
|
||
| RUN apk add --no-cache netcat-openbsd | ||
|
|
||
| COPY entrypoint.sh /usr/local/bin/entrypoint.sh | ||
| COPY seed-keyspace.sh /usr/local/bin/seed-keyspace.sh | ||
|
|
||
| # Override image entrypoint; keep default CMD (or set your own). | ||
| ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] | ||
| CMD ["redis-server"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| services: | ||
| redis: | ||
| build: | ||
| context: . | ||
| args: | ||
| SERVICE_VERSION: ${SERVICE_VERSION} | ||
| ports: | ||
| - 6379 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #!/bin/sh | ||
| set -eu | ||
|
|
||
| # Run seeding in background (it will wait for Redis to be ready) | ||
| /usr/local/bin/seed-keyspace.sh & | ||
|
|
||
| # Hand off to the original entrypoint/command in the foreground (PID 1) | ||
| exec docker-entrypoint.sh "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| #!/bin/sh | ||
| set -eu | ||
|
|
||
| # Minimal seeding script for local Redis inside the container. | ||
| # Uses only redis-cli defaults (local unix socket / localhost). No host/port flags. | ||
|
|
||
| MAX_WAIT_SECONDS="${MAX_WAIT_SECONDS:-30}" | ||
| SLEEP_SECONDS="${SLEEP_SECONDS:-0.2}" | ||
|
|
||
| KEY_PREFIX="${KEY_PREFIX:-test:keyspace}" | ||
| KEY_COUNT="${KEY_COUNT:-3}" | ||
|
|
||
| log() { | ||
| printf '%s\n' "$*" >&2 | ||
| } | ||
|
|
||
| if ! command -v redis-cli >/dev/null 2>&1; then | ||
| log "seed-keyspace: redis-cli not found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| log "seed-keyspace: waiting for local redis (max ${MAX_WAIT_SECONDS}s)" | ||
| end=$(( $(date +%s) + MAX_WAIT_SECONDS )) | ||
|
|
||
| until redis-cli PING >/dev/null 2>&1; do | ||
| if [ "$(date +%s)" -ge "${end}" ]; then | ||
| log "seed-keyspace: timed out waiting for redis" | ||
| # Print one last attempt output to help debugging. | ||
| redis-cli PING >&2 || true | ||
| exit 1 | ||
| fi | ||
| sleep "${SLEEP_SECONDS}" | ||
| done | ||
|
|
||
| log "seed-keyspace: redis is up; seeding ${KEY_COUNT} keys" | ||
|
|
||
| i=1 | ||
| while [ "${i}" -le "${KEY_COUNT}" ]; do | ||
| redis-cli SET "${KEY_PREFIX}:${i}" "value-${i}" >/dev/null | ||
| i=$((i + 1)) | ||
| done | ||
|
|
||
| # Optional: ensure it shows up in INFO keyspace. | ||
| if [ "${VERIFY_KEYSPACE:-1}" != "0" ]; then | ||
| redis-cli INFO keyspace | grep -E '^db0:' >/dev/null 2>&1 || { | ||
| log "seed-keyspace: seed done but INFO keyspace doesn't contain db0" | ||
| redis-cli INFO keyspace >&2 || true | ||
| exit 1 | ||
| } | ||
| log "seed-keyspace: verified db0 present" | ||
| fi | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| variants: | ||
| "v6": | ||
| SERVICE_VERSION: 6.2.6 | ||
| "v7": | ||
| SERVICE_VERSION: 7.4.7 | ||
| "v8": | ||
| SERVICE_VERSION: 8.2.3 | ||
| default: v8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/redis/data_stream/info/_dev/test/system/test-default-config.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| vars: | ||
| hosts: | ||
| - "{{Hostname}}:6379" | ||
| data_stream: | ||
| vars: ~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.