Skip to content

Prometheus Exporter for Redis Metrics. Supports Redis 2.x and 3.x

License

Notifications You must be signed in to change notification settings

DaoCloud/redis_exporter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redis Metrics Exporter

Circle CI Coverage Status

Prometheus exporter for Redis metrics.
Supports Redis 2.x and 3.x

Building, configuring, and running

Locally build and run it:

    $ go get
    $ go build
    $ ./redis_exporter <flags>

You can also run it via docker:

    $ docker pull 21zoo/redis_exporter
    $ docker run -d --name redis_exporter -p 9121:9121 21zoo/redis_exporter

Add a block to the scrape_configs of your prometheus.yml config file:

scrape_configs:

...

- job_name: redis_exporter
  target_groups:
  - targets: ['localhost:9121']

...

and adjust the host name accordingly.

Flags

Name Description
check-keys Comma separated list of keys to export value and length/size, eg: db3=user_count will export key user_count from db 3. db defaults to 0 if omitted.
redis.addr Address of one or more redis nodes, comma separated, defaults to localhost:6379.
redis.password Password to use when authenticating to Redis
namespace Namespace for the metrics, defaults to redis.
web.listen-address Address to listen on for web interface and telemetry, defaults to 0.0.0.0:9121.
web.telemetry-path Path under which to expose metrics, defaults to metrics.

These settings take precedence over any configurations provided by environment variables.

Environment Variables

Name Description
REDIS_PASSWORD Password to use when authenticating to Redis

What's exported?

Most items from the INFO command are exported, see http://redis.io/commands/info for details.
In addition, for every database there are metrics for total keys, expiring keys and the average TTL for keys in the database.
You can also export values of keys if they're in numeric format by using the -check-keys flag. The exporter will also export the size (or, depending on the data type, the length) of the key. This can be used to export the number of elements in (sorted) sets, hashes, lists, etc.

What does it look like?

Example PromDash screenshots:
screen1
screen2

What else?

Open an issue or PR if you have more suggestions or ideas about what to add.

About

Prometheus Exporter for Redis Metrics. Supports Redis 2.x and 3.x

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%