diff --git a/packages/redis/_dev/build/docs/README.md b/packages/redis/_dev/build/docs/README.md index 7e1389cc63b..598ab4b286d 100644 --- a/packages/redis/_dev/build/docs/README.md +++ b/packages/redis/_dev/build/docs/README.md @@ -7,8 +7,9 @@ This integration periodically fetches logs and metrics from [Redis](https://redi The `log` and `slowlog` datasets were tested with logs from Redis versions 1.2.6, 2.4.6, and 3.0.2, so we expect compatibility with any version 1.x, 2.x, or 3.x. -The `info`, `key` and `keyspace` datasets were tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected to work -with all versions `>= 3.0`. +The `info`, `key` and `keyspace` datasets were tested with Redis 6.2.6, 7.4.7, and 8.2.3, and are expected to work +with all versions `>= 3.0`. Fields specific to Redis 7.0+ (such as `commandstats`, script/function memory metrics, and +client-side caching tracking stats) and Redis 8.x are collected automatically when the server reports them. ## Logs diff --git a/packages/redis/_dev/deploy/docker/Dockerfile b/packages/redis/_dev/deploy/docker/Dockerfile index dc23cce5a17..6fc5f71d411 100644 --- a/packages/redis/_dev/deploy/docker/Dockerfile +++ b/packages/redis/_dev/deploy/docker/Dockerfile @@ -1,3 +1,12 @@ -ARG REDIS_VERSION -FROM redis:${REDIS_VERSION}-alpine +ARG SERVICE_VERSION=${SERVICE_VERSION:-8.2.3} +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"] \ No newline at end of file diff --git a/packages/redis/_dev/deploy/docker/docker-compose.yml b/packages/redis/_dev/deploy/docker/docker-compose.yml index 2a559c9e83a..0ccf02898a2 100644 --- a/packages/redis/_dev/deploy/docker/docker-compose.yml +++ b/packages/redis/_dev/deploy/docker/docker-compose.yml @@ -1,11 +1,8 @@ -version: '2.3' services: redis: - image: docker.elastic.co/integrations-ci/beats-redis:${REDIS_VERSION:-3.2.12}-1 build: context: . args: - REDIS_VERSION: ${REDIS_VERSION:-3.2.12} - privileged: true + SERVICE_VERSION: ${SERVICE_VERSION} ports: - 6379 diff --git a/packages/redis/_dev/deploy/docker/entrypoint.sh b/packages/redis/_dev/deploy/docker/entrypoint.sh new file mode 100755 index 00000000000..11a4ba64d3e --- /dev/null +++ b/packages/redis/_dev/deploy/docker/entrypoint.sh @@ -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 "$@" diff --git a/packages/redis/_dev/deploy/docker/seed-keyspace.sh b/packages/redis/_dev/deploy/docker/seed-keyspace.sh new file mode 100755 index 00000000000..3d33114802d --- /dev/null +++ b/packages/redis/_dev/deploy/docker/seed-keyspace.sh @@ -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 + diff --git a/packages/redis/_dev/deploy/variants.yml b/packages/redis/_dev/deploy/variants.yml new file mode 100644 index 00000000000..e017e86e125 --- /dev/null +++ b/packages/redis/_dev/deploy/variants.yml @@ -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 diff --git a/packages/redis/changelog.yml b/packages/redis/changelog.yml index 570521da61a..0f1c3564c97 100644 --- a/packages/redis/changelog.yml +++ b/packages/redis/changelog.yml @@ -1,4 +1,9 @@ # newer versions go on top +- version: "1.21.0" + changes: + - description: Add new fields for Redis 7.x and 8.x + type: enhancement + link: https://github.com/elastic/integrations/pull/16732 - version: "1.20.0" changes: - description: Allow @custom pipeline access to event.original without setting preserve_original_event. diff --git a/packages/redis/data_stream/info/_dev/test/system/test-default-config.yml b/packages/redis/data_stream/info/_dev/test/system/test-default-config.yml index 9900b764181..0b648f4e26e 100644 --- a/packages/redis/data_stream/info/_dev/test/system/test-default-config.yml +++ b/packages/redis/data_stream/info/_dev/test/system/test-default-config.yml @@ -1,5 +1,5 @@ vars: - hosts: ["http://{{Hostname}}:{{Port}}"] + hosts: + - "{{Hostname}}:6379" data_stream: vars: ~ - \ No newline at end of file diff --git a/packages/redis/data_stream/info/fields/fields.yml b/packages/redis/data_stream/info/fields/fields.yml index 867126ea4ef..18f412350c1 100644 --- a/packages/redis/data_stream/info/fields/fields.yml +++ b/packages/redis/data_stream/info/fields/fields.yml @@ -89,12 +89,60 @@ type: long format: bytes metric_type: gauge - description: "Used memory by the Lua engine. \n" + description: "Used memory by the Lua engine. Deprecated in Redis 7.0; use vm.eval instead." + - name: used.scripts + type: long + format: bytes + description: > + Combined memory overhead from EVAL scripts and Functions (part of used_memory). Added in Redis 7.0. + + - name: used.scripts_eval + type: long + format: bytes + description: > + Memory overhead from EVAL scripts (part of used_memory). Added in Redis 7.0. + + - name: used.functions + type: long + format: bytes + description: > + Memory overhead from Functions (part of used_memory). Added in Redis 7.0. + - name: used.dataset type: long format: bytes metric_type: gauge description: "The size in bytes of the dataset \n" + - name: vm + type: group + description: > + Redis 7.0+ VM memory stats. VM memory is NOT part of used_memory. + + fields: + - name: eval + type: long + format: bytes + description: > + Number of bytes used by the script VM engines for EVAL framework. This is the replacement for used_memory_lua. + + - name: functions + type: long + format: bytes + description: > + Number of bytes used by the script VM engines for Functions framework. + + - name: total + type: long + format: bytes + description: > + Total VM memory (vm.eval + vm.functions). + + - name: total_system + type: long + format: bytes + description: > + Total amount in bytes of memory available to Redis. + - name: max.value type: long format: bytes @@ -401,6 +449,21 @@ type: long - name: config_file type: keyword + - name: number_of_cached_scripts + type: long + description: > + Number of EVAL scripts cached by the server. Added in Redis 7.0. + + - name: number_of_functions + type: long + description: > + Number of Functions loaded. Added in Redis 7.0. + + - name: number_of_libraries + type: long + description: > + Number of Function libraries loaded. Added in Redis 7.0. + - name: stats type: group fields: @@ -519,11 +582,63 @@ metric_type: gauge description: | Number of keys that were skipped by the active defragmentation process + - name: tracking + type: group + description: > + Redis client-side caching tracking stats. Added in Redis 6.0. + + fields: + - name: total_keys + type: long + description: > + Number of keys being tracked by the server. + + - name: total_items + type: long + description: > + Number of items (sum of clients per tracked key). + + - name: total_prefixes + type: long + description: > + Number of tracked prefixes in the server's prefix table (broadcast mode only). + - name: slowlog.count type: long metric_type: gauge description: | Count of slow operations + - name: commandstats + type: group + description: > + Redis command statistics + + fields: + - name: "*.calls" + type: long + description: > + The number of calls that reached command execution (not rejected). + + - name: "*.usec" + type: long + description: > + The total CPU time consumed by these commands. + + - name: "*.usec_per_call" + type: float + description: > + The average CPU consumed per command execution. + + - name: "*.rejected_calls" + type: long + description: > + The number of rejected calls (on redis 6.2-rc2). + + - name: "*.failed_calls" + type: long + description: > + The number of failed calls (on redis 6.2-rc2). + - name: os type: group description: The OS fields contain information about the operating system. diff --git a/packages/redis/data_stream/info/manifest.yml b/packages/redis/data_stream/info/manifest.yml index 0f7195866a5..97f0dcd08fa 100644 --- a/packages/redis/data_stream/info/manifest.yml +++ b/packages/redis/data_stream/info/manifest.yml @@ -18,6 +18,7 @@ streams: show_user: false description: > Processors are used to reduce the number of fields in the exported event or to enhance the event with metadata. This executes in the agent before the events are shipped. See [Processors](https://www.elastic.co/guide/en/fleet/current/elastic-agent-processor-configuration.html) for details. + title: Redis info metrics description: Collect Redis info metrics elasticsearch: diff --git a/packages/redis/data_stream/info/sample_event.json b/packages/redis/data_stream/info/sample_event.json index 64bc5854cdb..165b194574e 100644 --- a/packages/redis/data_stream/info/sample_event.json +++ b/packages/redis/data_stream/info/sample_event.json @@ -1,11 +1,25 @@ { - "@timestamp": "2020-06-25T10:16:10.138Z", + "@timestamp": "2026-02-03T11:45:23.125Z", + "agent": { + "ephemeral_id": "e6713a3c-f7db-4012-8e92-5c8960315000", + "id": "4a53e83d-7ea0-45aa-a662-f6d5e65edcc1", + "name": "elastic-agent-76901", + "type": "metricbeat", + "version": "9.3.0" + }, + "data_stream": { + "dataset": "redis.info", + "namespace": "18585", + "type": "metrics" + }, "ecs": { - "version": "8.11.0" + "version": "8.0.0" }, "event": { + "agent_id_status": "verified", "dataset": "redis.info", - "duration": 374411, + "duration": 1723943, + "ingested": "2026-02-03T11:45:26Z", "module": "redis" }, "metricset": { @@ -15,43 +29,84 @@ "redis": { "info": { "clients": { - "biggest_input_buf": 0, "blocked": 0, - "connected": 5, - "longest_output_list": 0, + "connected": 1, "max_input_buffer": 0, "max_output_buffer": 0 }, "cluster": { "enabled": false }, + "commandstats": { + "config|get": { + "calls": 2, + "failed_calls": 0, + "rejected_calls": 0, + "usec": 3, + "usec_per_call": 1.5 + }, + "info": { + "calls": 7, + "failed_calls": 0, + "rejected_calls": 0, + "usec": 34, + "usec_per_call": 4.86 + }, + "ping": { + "calls": 1, + "failed_calls": 0, + "rejected_calls": 0, + "usec": 2, + "usec_per_call": 2 + }, + "set": { + "calls": 3, + "failed_calls": 0, + "rejected_calls": 0, + "usec": 14, + "usec_per_call": 4.67 + } + }, "cpu": { "used": { - "sys": 1.66, + "sys": 0.012, "sys_children": 0, - "user": 0.39, - "user_children": 0.01 + "user": 0.023, + "user_children": 0.004 } }, "memory": { - "active_defrag": {}, - "allocator": "jemalloc-4.0.3", + "active_defrag": { + "is_running": false + }, + "allocator": "jemalloc-5.3.0", "allocator_stats": { - "fragmentation": {}, - "rss": {} + "active": 14680064, + "allocated": 5613888, + "fragmentation": { + "bytes": 5818304, + "ratio": 2.64 + }, + "resident": 16056320, + "rss": { + "bytes": 1376256, + "ratio": 1.09 + } }, "fragmentation": { - "ratio": 2.71 + "bytes": 20554008, + "ratio": 20.16 }, "max": { "policy": "noeviction", "value": 0 }, "used": { - "lua": 37888, - "peak": 945016, - "rss": 2453504, - "value": 904992 + "dataset": 22656, + "lua": 32768, + "peak": 1092536, + "rss": 21626880, + "value": 1092536 } }, "persistence": { @@ -59,12 +114,11 @@ "bgrewrite": { "last_status": "ok" }, - "buffer": {}, - "copy_on_write": {}, + "copy_on_write": { + "last_size": 0 + }, "enabled": false, - "fsync": {}, "rewrite": { - "buffer": {}, "current_time": { "sec": -1 }, @@ -74,7 +128,6 @@ }, "scheduled": false }, - "size": {}, "write": { "last_status": "ok" } @@ -91,10 +144,12 @@ "sec": -1 } }, - "copy_on_write": {}, + "copy_on_write": { + "last_size": 0 + }, "last_save": { - "changes_since": 35, - "time": 1548663522 + "changes_since": 3, + "time": 1770119112 } } }, @@ -108,64 +163,68 @@ "connected_slaves": 0, "master": { "offset": 0, - "sync": {} + "second_offset": -1 }, - "master_offset": 0, - "role": "master", - "slave": {} + "role": "master" }, "server": { "arch_bits": "64", - "build_id": "b9a4cd86ce8027d3", + "build_id": "b492540641d75a88", "config_file": "", - "gcc_version": "6.4.0", - "git_dirty": "0", + "gcc_version": "14.2.0", + "git_dirty": "1", "git_sha1": "00000000", "hz": 10, - "lru_clock": 5159690, + "lru_clock": 8511443, "mode": "standalone", "multiplexing_api": "epoll", - "run_id": "0f681cb959aa47413ec40ff383715c923f9cbefd", + "run_id": "ee88be441848ccfe025e53771ded922d6e965d00", "tcp_port": 6379, - "uptime": 707 + "uptime": 11 }, "slowlog": { "count": 0 }, "stats": { - "active_defrag": {}, - "commands_processed": 265, + "active_defrag": { + "hits": 0, + "key_hits": 0, + "key_misses": 0, + "misses": 0 + }, + "commands_processed": 13, "connections": { - "received": 848, + "received": 16, "rejected": 0 }, "instantaneous": { - "input_kbps": 0.18, - "ops_per_sec": 6, - "output_kbps": 1.39 + "input_kbps": 0, + "ops_per_sec": 0, + "output_kbps": 0 }, "keys": { "evicted": 0, "expired": 0 }, "keyspace": { - "hits": 15, + "hits": 0, "misses": 0 }, "latest_fork_usec": 0, "migrate_cached_sockets": 0, "net": { "input": { - "bytes": 7300 + "bytes": 209 }, "output": { - "bytes": 219632 + "bytes": 85 } }, "pubsub": { "channels": 0, "patterns": 0 }, + "slave_expires_tracked_keys": 0, "sync": { "full": 0, "partial": { @@ -177,7 +236,8 @@ } }, "service": { - "address": "localhost:6379", - "type": "redis" + "address": "redis://svc-redis:6379", + "type": "redis", + "version": "8.2.3" } -} \ No newline at end of file +} diff --git a/packages/redis/data_stream/key/_dev/test/system/test-default-config.yml b/packages/redis/data_stream/key/_dev/test/system/test-default-config.yml new file mode 100644 index 00000000000..0b648f4e26e --- /dev/null +++ b/packages/redis/data_stream/key/_dev/test/system/test-default-config.yml @@ -0,0 +1,5 @@ +vars: + hosts: + - "{{Hostname}}:6379" +data_stream: + vars: ~ diff --git a/packages/redis/data_stream/key/fields/fields.yml b/packages/redis/data_stream/key/fields/fields.yml index c1c51ed7f36..db61e8936a8 100644 --- a/packages/redis/data_stream/key/fields/fields.yml +++ b/packages/redis/data_stream/key/fields/fields.yml @@ -1,3 +1,12 @@ +- name: redis.keyspace + type: group + fields: + - name: id + type: keyword + # Reason to add as dimension field: Multiple keyspace can exist and are part of multiple documents. + dimension: true + description: | + Keyspace identifier. - name: redis.key type: group fields: diff --git a/packages/redis/data_stream/key/manifest.yml b/packages/redis/data_stream/key/manifest.yml index cdffbce0a7a..6d381df5985 100644 --- a/packages/redis/data_stream/key/manifest.yml +++ b/packages/redis/data_stream/key/manifest.yml @@ -25,8 +25,7 @@ streams: multi: false required: false show_user: false - description: > - Processors are used to reduce the number of fields in the exported event or to enhance the event with metadata. This executes in the agent before the events are shipped. See [Processors](https://www.elastic.co/guide/en/fleet/current/elastic-agent-processor-configuration.html) for details. + description: "Processors are used to reduce the number of fields in the exported event or to enhance the event with metadata. This executes in the agent before the events are shipped. See [Processors](https://www.elastic.co/guide/en/fleet/current/elastic-agent-processor-configuration.html) for details. \n" title: Redis key metrics description: Collect Redis key metrics elasticsearch: diff --git a/packages/redis/data_stream/key/sample_event.json b/packages/redis/data_stream/key/sample_event.json index e8366765c81..3e5076325ff 100644 --- a/packages/redis/data_stream/key/sample_event.json +++ b/packages/redis/data_stream/key/sample_event.json @@ -1,11 +1,13 @@ { - "@timestamp": "2020-06-25T10:16:10.138Z", + "@timestamp": "2025-12-31T13:20:46.958Z", "ecs": { - "version": "8.11.0" + "version": "8.0.0" }, "event": { + "agent_id_status": "verified", "dataset": "redis.key", - "duration": 374411, + "duration": 9857625, + "ingested": "2025-12-31T13:20:48Z", "module": "redis" }, "metricset": { @@ -15,16 +17,19 @@ "redis": { "key": { "expire": { - "ttl": 360 + "ttl": -1 }, - "id": "0:foo", - "length": 3, - "name": "foo", + "id": "0:test", + "length": 1, + "name": "test", "type": "string" + }, + "keyspace": { + "id": "db0" } }, "service": { - "address": "localhost:6379", + "address": "redis://127.0.0.1:6379", "type": "redis" } } \ No newline at end of file diff --git a/packages/redis/data_stream/keyspace/_dev/test/system/test-default-config.yml b/packages/redis/data_stream/keyspace/_dev/test/system/test-default-config.yml new file mode 100644 index 00000000000..0b648f4e26e --- /dev/null +++ b/packages/redis/data_stream/keyspace/_dev/test/system/test-default-config.yml @@ -0,0 +1,5 @@ +vars: + hosts: + - "{{Hostname}}:6379" +data_stream: + vars: ~ diff --git a/packages/redis/data_stream/keyspace/fields/fields.yml b/packages/redis/data_stream/keyspace/fields/fields.yml index 111a858fc40..c13b7aaaf50 100644 --- a/packages/redis/data_stream/keyspace/fields/fields.yml +++ b/packages/redis/data_stream/keyspace/fields/fields.yml @@ -18,3 +18,6 @@ Number of keys in the keyspace. - name: expires type: long + - name: subexpiry + type: long + description: "Number of sub-keys with an expiry set (0 when not reported)." diff --git a/packages/redis/data_stream/keyspace/manifest.yml b/packages/redis/data_stream/keyspace/manifest.yml index 27c39d35fbc..89023c868d2 100644 --- a/packages/redis/data_stream/keyspace/manifest.yml +++ b/packages/redis/data_stream/keyspace/manifest.yml @@ -18,6 +18,7 @@ streams: show_user: false description: > Processors are used to reduce the number of fields in the exported event or to enhance the event with metadata. This executes in the agent before the events are shipped. See [Processors](https://www.elastic.co/guide/en/fleet/current/elastic-agent-processor-configuration.html) for details. + title: Redis keyspace metrics description: Collect Redis keyspace metrics elasticsearch: diff --git a/packages/redis/data_stream/slowlog/manifest.yml b/packages/redis/data_stream/slowlog/manifest.yml index ba0b07e3a87..e16671d5572 100644 --- a/packages/redis/data_stream/slowlog/manifest.yml +++ b/packages/redis/data_stream/slowlog/manifest.yml @@ -25,7 +25,6 @@ streams: multi: false required: false show_user: false - description: > - Processors are used to reduce the number of fields in the exported event or to enhance the event with metadata. This executes in the agent before the events are shipped. See [Processors](https://www.elastic.co/guide/en/fleet/current/elastic-agent-processor-configuration.html) for details. + description: "Processors are used to reduce the number of fields in the exported event or to enhance the event with metadata. This executes in the agent before the events are shipped. See [Processors](https://www.elastic.co/guide/en/fleet/current/elastic-agent-processor-configuration.html) for details. \n" title: Redis slow logs description: Collect Redis slow logs diff --git a/packages/redis/docs/README.md b/packages/redis/docs/README.md index 727d7ebc3d3..3bce3977017 100644 --- a/packages/redis/docs/README.md +++ b/packages/redis/docs/README.md @@ -7,8 +7,9 @@ This integration periodically fetches logs and metrics from [Redis](https://redi The `log` and `slowlog` datasets were tested with logs from Redis versions 1.2.6, 2.4.6, and 3.0.2, so we expect compatibility with any version 1.x, 2.x, or 3.x. -The `info`, `key` and `keyspace` datasets were tested with Redis 3.2.12, 4.0.11 and 5.0-rc4, and are expected to work -with all versions `>= 3.0`. +The `info`, `key` and `keyspace` datasets were tested with Redis 6.2.6, 7.4.7, and 8.2.3, and are expected to work +with all versions `>= 3.0`. Fields specific to Redis 7.0+ (such as `commandstats`, script/function memory metrics, and +client-side caching tracking stats) and Redis 8.x are collected automatically when the server reports them. ## Logs @@ -73,13 +74,27 @@ An example event for `info` looks as following: ```json { - "@timestamp": "2020-06-25T10:16:10.138Z", + "@timestamp": "2026-02-03T11:45:23.125Z", + "agent": { + "ephemeral_id": "e6713a3c-f7db-4012-8e92-5c8960315000", + "id": "4a53e83d-7ea0-45aa-a662-f6d5e65edcc1", + "name": "elastic-agent-76901", + "type": "metricbeat", + "version": "9.3.0" + }, + "data_stream": { + "dataset": "redis.info", + "namespace": "18585", + "type": "metrics" + }, "ecs": { - "version": "8.11.0" + "version": "8.0.0" }, "event": { + "agent_id_status": "verified", "dataset": "redis.info", - "duration": 374411, + "duration": 1723943, + "ingested": "2026-02-03T11:45:26Z", "module": "redis" }, "metricset": { @@ -89,43 +104,84 @@ An example event for `info` looks as following: "redis": { "info": { "clients": { - "biggest_input_buf": 0, "blocked": 0, - "connected": 5, - "longest_output_list": 0, + "connected": 1, "max_input_buffer": 0, "max_output_buffer": 0 }, "cluster": { "enabled": false }, + "commandstats": { + "config|get": { + "calls": 2, + "failed_calls": 0, + "rejected_calls": 0, + "usec": 3, + "usec_per_call": 1.5 + }, + "info": { + "calls": 7, + "failed_calls": 0, + "rejected_calls": 0, + "usec": 34, + "usec_per_call": 4.86 + }, + "ping": { + "calls": 1, + "failed_calls": 0, + "rejected_calls": 0, + "usec": 2, + "usec_per_call": 2 + }, + "set": { + "calls": 3, + "failed_calls": 0, + "rejected_calls": 0, + "usec": 14, + "usec_per_call": 4.67 + } + }, "cpu": { "used": { - "sys": 1.66, + "sys": 0.012, "sys_children": 0, - "user": 0.39, - "user_children": 0.01 + "user": 0.023, + "user_children": 0.004 } }, "memory": { - "active_defrag": {}, - "allocator": "jemalloc-4.0.3", + "active_defrag": { + "is_running": false + }, + "allocator": "jemalloc-5.3.0", "allocator_stats": { - "fragmentation": {}, - "rss": {} + "active": 14680064, + "allocated": 5613888, + "fragmentation": { + "bytes": 5818304, + "ratio": 2.64 + }, + "resident": 16056320, + "rss": { + "bytes": 1376256, + "ratio": 1.09 + } }, "fragmentation": { - "ratio": 2.71 + "bytes": 20554008, + "ratio": 20.16 }, "max": { "policy": "noeviction", "value": 0 }, "used": { - "lua": 37888, - "peak": 945016, - "rss": 2453504, - "value": 904992 + "dataset": 22656, + "lua": 32768, + "peak": 1092536, + "rss": 21626880, + "value": 1092536 } }, "persistence": { @@ -133,12 +189,11 @@ An example event for `info` looks as following: "bgrewrite": { "last_status": "ok" }, - "buffer": {}, - "copy_on_write": {}, + "copy_on_write": { + "last_size": 0 + }, "enabled": false, - "fsync": {}, "rewrite": { - "buffer": {}, "current_time": { "sec": -1 }, @@ -148,7 +203,6 @@ An example event for `info` looks as following: }, "scheduled": false }, - "size": {}, "write": { "last_status": "ok" } @@ -165,10 +219,12 @@ An example event for `info` looks as following: "sec": -1 } }, - "copy_on_write": {}, + "copy_on_write": { + "last_size": 0 + }, "last_save": { - "changes_since": 35, - "time": 1548663522 + "changes_since": 3, + "time": 1770119112 } } }, @@ -182,64 +238,68 @@ An example event for `info` looks as following: "connected_slaves": 0, "master": { "offset": 0, - "sync": {} + "second_offset": -1 }, - "master_offset": 0, - "role": "master", - "slave": {} + "role": "master" }, "server": { "arch_bits": "64", - "build_id": "b9a4cd86ce8027d3", + "build_id": "b492540641d75a88", "config_file": "", - "gcc_version": "6.4.0", - "git_dirty": "0", + "gcc_version": "14.2.0", + "git_dirty": "1", "git_sha1": "00000000", "hz": 10, - "lru_clock": 5159690, + "lru_clock": 8511443, "mode": "standalone", "multiplexing_api": "epoll", - "run_id": "0f681cb959aa47413ec40ff383715c923f9cbefd", + "run_id": "ee88be441848ccfe025e53771ded922d6e965d00", "tcp_port": 6379, - "uptime": 707 + "uptime": 11 }, "slowlog": { "count": 0 }, "stats": { - "active_defrag": {}, - "commands_processed": 265, + "active_defrag": { + "hits": 0, + "key_hits": 0, + "key_misses": 0, + "misses": 0 + }, + "commands_processed": 13, "connections": { - "received": 848, + "received": 16, "rejected": 0 }, "instantaneous": { - "input_kbps": 0.18, - "ops_per_sec": 6, - "output_kbps": 1.39 + "input_kbps": 0, + "ops_per_sec": 0, + "output_kbps": 0 }, "keys": { "evicted": 0, "expired": 0 }, "keyspace": { - "hits": 15, + "hits": 0, "misses": 0 }, "latest_fork_usec": 0, "migrate_cached_sockets": 0, "net": { "input": { - "bytes": 7300 + "bytes": 209 }, "output": { - "bytes": 219632 + "bytes": 85 } }, "pubsub": { "channels": 0, "patterns": 0 }, + "slave_expires_tracked_keys": 0, "sync": { "full": 0, "partial": { @@ -251,8 +311,9 @@ An example event for `info` looks as following: } }, "service": { - "address": "localhost:6379", - "type": "redis" + "address": "redis://svc-redis:6379", + "type": "redis", + "version": "8.2.3" } } ``` @@ -292,6 +353,11 @@ Please refer to the following [document](https://www.elastic.co/guide/en/ecs/cur | redis.info.clients.max_input_buffer | Biggest input buffer among current client connections (on redis 5.0). | long | gauge | | redis.info.clients.max_output_buffer | Longest output list among current client connections. | long | gauge | | redis.info.cluster.enabled | Indicates that the Redis cluster is enabled. | boolean | | +| redis.info.commandstats.\*.calls | The number of calls that reached command execution (not rejected). | long | | +| redis.info.commandstats.\*.failed_calls | The number of failed calls (on redis 6.2-rc2). | long | | +| redis.info.commandstats.\*.rejected_calls | The number of rejected calls (on redis 6.2-rc2). | long | | +| redis.info.commandstats.\*.usec | The total CPU time consumed by these commands. | long | | +| redis.info.commandstats.\*.usec_per_call | The average CPU consumed per command execution. | float | | | redis.info.cpu.used.sys | System CPU consumed by the Redis server. | scaled_float | gauge | | redis.info.cpu.used.sys_children | User CPU consumed by the Redis server. | scaled_float | gauge | | redis.info.cpu.used.user | System CPU consumed by the background processes. | scaled_float | gauge | @@ -309,11 +375,18 @@ Please refer to the following [document](https://www.elastic.co/guide/en/ecs/cur | redis.info.memory.fragmentation.ratio | Ratio between used_memory_rss and used_memory | float | gauge | | redis.info.memory.max.policy | Eviction policy to use when memory limit is reached. | keyword | | | redis.info.memory.max.value | Memory limit. | long | gauge | +| redis.info.memory.total_system | Total amount in bytes of memory available to Redis. | long | | | redis.info.memory.used.dataset | The size in bytes of the dataset | long | gauge | -| redis.info.memory.used.lua | Used memory by the Lua engine. | long | gauge | +| redis.info.memory.used.functions | Memory overhead from Functions (part of used_memory). Added in Redis 7.0. | long | | +| redis.info.memory.used.lua | Used memory by the Lua engine. Deprecated in Redis 7.0; use vm.eval instead. | long | gauge | | redis.info.memory.used.peak | Peak memory consumed by Redis. | long | gauge | | redis.info.memory.used.rss | Number of bytes that Redis allocated as seen by the operating system (a.k.a resident set size). | long | gauge | +| redis.info.memory.used.scripts | Combined memory overhead from EVAL scripts and Functions (part of used_memory). Added in Redis 7.0. | long | | +| redis.info.memory.used.scripts_eval | Memory overhead from EVAL scripts (part of used_memory). Added in Redis 7.0. | long | | | redis.info.memory.used.value | Total number of bytes allocated by Redis. | long | gauge | +| redis.info.memory.vm.eval | Number of bytes used by the script VM engines for EVAL framework. This is the replacement for used_memory_lua. | long | | +| redis.info.memory.vm.functions | Number of bytes used by the script VM engines for Functions framework. | long | | +| redis.info.memory.vm.total | Total VM memory (vm.eval + vm.functions). | long | | | redis.info.persistence.aof.bgrewrite.last_status | Status of the last AOF rewrite operatio | keyword | | | redis.info.persistence.aof.buffer.size | Size of the AOF buffer | long | gauge | | redis.info.persistence.aof.copy_on_write.last_size | The size in bytes of copy-on-write allocations during the last RBD save operation | long | gauge | @@ -363,6 +436,9 @@ Please refer to the following [document](https://www.elastic.co/guide/en/ecs/cur | redis.info.server.lru_clock | | long | | | redis.info.server.mode | | keyword | | | redis.info.server.multiplexing_api | | keyword | | +| redis.info.server.number_of_cached_scripts | Number of EVAL scripts cached by the server. Added in Redis 7.0. | long | | +| redis.info.server.number_of_functions | Number of Functions loaded. Added in Redis 7.0. | long | | +| redis.info.server.number_of_libraries | Number of Function libraries loaded. Added in Redis 7.0. | long | | | redis.info.server.run_id | | keyword | | | redis.info.server.tcp_port | | long | | | redis.info.server.uptime | | long | gauge | @@ -391,6 +467,9 @@ Please refer to the following [document](https://www.elastic.co/guide/en/ecs/cur | redis.info.stats.sync.full | The number of full resyncs with slaves | long | gauge | | redis.info.stats.sync.partial.err | The number of denied partial resync requests | long | gauge | | redis.info.stats.sync.partial.ok | The number of accepted partial resync requests | long | gauge | +| redis.info.stats.tracking.total_items | Number of items (sum of clients per tracked key). | long | | +| redis.info.stats.tracking.total_keys | Number of keys being tracked by the server. | long | | +| redis.info.stats.tracking.total_prefixes | Number of tracked prefixes in the server's prefix table (broadcast mode only). | long | | | service.address | Address where data about this service was collected from. This should be a URI, network address (ipv4:port or [ipv6]:port) or a resource path (sockets). | keyword | | @@ -411,13 +490,15 @@ An example event for `key` looks as following: ```json { - "@timestamp": "2020-06-25T10:16:10.138Z", + "@timestamp": "2025-12-31T13:20:46.958Z", "ecs": { - "version": "8.11.0" + "version": "8.0.0" }, "event": { + "agent_id_status": "verified", "dataset": "redis.key", - "duration": 374411, + "duration": 9857625, + "ingested": "2025-12-31T13:20:48Z", "module": "redis" }, "metricset": { @@ -427,16 +508,19 @@ An example event for `key` looks as following: "redis": { "key": { "expire": { - "ttl": 360 + "ttl": -1 }, - "id": "0:foo", - "length": 3, - "name": "foo", + "id": "0:test", + "length": 1, + "name": "test", "type": "string" + }, + "keyspace": { + "id": "db0" } }, "service": { - "address": "localhost:6379", + "address": "redis://127.0.0.1:6379", "type": "redis" } } @@ -473,6 +557,7 @@ Please refer to the following [document](https://www.elastic.co/guide/en/ecs/cur | redis.key.length | Length of the key (Number of elements for lists, length for strings, cardinality for sets). | long | gauge | | redis.key.name | Key name. | keyword | | | redis.key.type | Key type as shown by `TYPE` command. | keyword | | +| redis.keyspace.id | Keyspace identifier. | keyword | | | service.address | Address where data about this service was collected from. This should be a URI, network address (ipv4:port or [ipv6]:port) or a resource path (sockets). | keyword | | @@ -543,4 +628,5 @@ Please refer to the following [document](https://www.elastic.co/guide/en/ecs/cur | redis.keyspace.expires | | long | | | redis.keyspace.id | Keyspace identifier. | keyword | | | redis.keyspace.keys | Number of keys in the keyspace. | long | | +| redis.keyspace.subexpiry | Number of sub-keys with an expiry set (0 when not reported). | long | | | service.address | Address where data about this service was collected from. This should be a URI, network address (ipv4:port or [ipv6]:port) or a resource path (sockets). | keyword | | diff --git a/packages/redis/manifest.yml b/packages/redis/manifest.yml index 82337e7208c..877241d8588 100644 --- a/packages/redis/manifest.yml +++ b/packages/redis/manifest.yml @@ -1,7 +1,7 @@ format_version: "3.0.2" name: redis title: Redis -version: "1.20.0" +version: "1.21.0" description: Collect logs and metrics from Redis servers with Elastic Agent. type: integration categories: @@ -9,7 +9,7 @@ categories: - observability conditions: kibana: - version: "^8.13.0 || ^9.0.0" + version: "^9.4.0" elastic: subscription: basic screenshots: