Clone this repo:
  1. d287de4 debian: update patches by Filippo Giunchedi · 7 years ago master
  2. 3f18af6 Merge tag 'v0.13' by Filippo Giunchedi · 7 years ago
  3. 19f9849 New upstream release by Filippo Giunchedi · 7 years ago
  4. 4d2a346 Merge pull request #105 from catawiki/replication by Oliver · 7 years ago v0.13
  5. b4d1b1c New upstream release by Filippo Giunchedi · 7 years ago

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 oliver006/redis_exporter
    $ docker run -d --name redis_exporter -p 9121:9121 oliver006/redis_exporter

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

scrape_configs:

...

- job_name: redis_exporter
  static_configs:
  - _targets: ['localhost:9121']

...

and adjust the host name accordingly.

To run on Cloud Foundry, use:

cf push -f contrib/manifest.yml

Flags

NameDescription
debugVerbose debug output
log-formatLog format, valid options are txt (default) and json.
check-keysComma 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.addrAddress of one or more redis nodes, comma separated, defaults to redis://localhost:6379.
redis.passwordPassword to use when authenticating to Redis
redis.aliasAlias for redis node addr, comma separated.
redis.filePath to file containing one or more redis nodes, separated by newline. This option is mutually exclusive with redis.addr. Each line can optionally be comma-separated with the fields ,,.
namespaceNamespace for the metrics, defaults to redis.
web.listen-addressAddress to listen on for web interface and telemetry, defaults to 0.0.0.0:9121.
web.telemetry-pathPath under which to expose metrics, defaults to metrics.
use-cf-bindingsEnable usage of Cloud Foundry service bindings. Defaults to false

Redis node addresses can be tcp addresses like redis://localhost:6379, redis.example.com:6379 or unix socket addresses like unix:///tmp/redis.sock.
SSL is supported by using the rediss:// schema, for example: rediss://azure-ssl-enabled-host.redis.cache.windows.net:6380 (note that the port is required when connecting to a non-standard 6379 port, e.g. with Azure Redis instances).

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

Environment Variables

NameDescription
REDIS_ADDRAddress of Redis node(s)
REDIS_PASSWORDPassword to use when authenticating to Redis
REDIS_ALIASAlias name of Redis node(s)
REDIS_FILEPath to file containing Redis node(s)

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 Grafana screenshots:

Grafana dashboard is available on grafana.net and/or github.com.

Grafana dashboard with host & alias selector is available on github.com.

What else?

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

  NODES
Idea 1
idea 1
Note 1
os 9
web 3