Type to search.

Redis key metricset

Serverless

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Serverless interfaces and procedures might differ from classic Elastic Stack deployments.

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

The Redis key metricset collects information about Redis keys.

For each key matching one of the configured patterns, an event is sent to Elasticsearch with information about this key, what includes the type, its length when available, and its ttl.

Patterns are configured as a list containing these fields:

  • pattern (required): pattern for key names, as accepted by the Redis KEYS or SCAN commands.
  • limit (optional): safeguard when using patterns with wildcards to avoid collecting too many keys (Default: 0, no limit)
  • keyspace (optional): Identifier of the database to use to look for the keys (Default: 0)

For example the following configuration will collect information about all keys whose name starts with pipeline-*, with a limit of 20 keys.

YAML
- module: redis
  metricsets: ['key']
  key.patterns:
    - pattern: 'pipeline-*'
      limit: 20

The Redis key metricset comes with a predefined dashboard. For example:

metricbeat redis key dashboard

For a description of each field in the metricset, see the exported fields section.

Here is an example document generated by this metricset:

JSON
{
    "@timestamp": "2017-10-12T08:05:34.853Z",
    "agent": {
        "hostname": "host.example.com",
        "name": "host.example.com"
    },
    "event": {
        "dataset": "redis.key",
        "duration": 115000,
        "module": "redis"
    },
    "metricset": {
        "name": "key"
    },
    "redis": {
        "key": {
            "expire": {
                "ttl": 360
            },
            "id": "0:foo",
            "length": 3,
            "name": "foo",
            "type": "string"
        },
        "keyspace": {
            "id": "db0"
        }
    },
    "service": {
        "address": "127.0.0.1:6379",
        "type": "redis"
    }
}