Skip to content

globocom/redis-healthy

Repository files navigation

license Go Report Card Build Status

redis-healthy

It retrieves metrics periodically from Redis (or sentinel) (such as latency, connected_clients, instantaneous_ops_per_sec and others) and send them to Logstash.

Plotting the metrics with Grafana

Redis Sample Metrics

Tests

make test

Metrics

{
   client_longest_output_list: 15,
   instantaneous_input_kbps: 0,
   sync_partial_err: 0,
   latency: 361,
   connected_clients: 398,
   blocked_clients: 0,
   keyspace_hits: 201980,
   client: 'app-redis',
   instantaneous_ops_per_sec: 1092,
   instantaneous_output_kbps: 504,
   sync_full: 0,
   keyspace_misses: 1093,
   mem_fragmentation_ratio: 0,
   rejected_connections: 0,
   sync_partial_ok: 0
}

Options

Variable Mandatory Description
PROJECT Y An identifier for the metrics.
It'll be send as "client": PROJECT + "-redis"
PING_FREQUENCY Frequency in seconds that the metrics are fetched.
Default: 10
REDIS_HOST Y Redis host with port.
If you're using redis sentinel, then REDIS_HOST will host the sentinel hosts separated by commas ("host:port,host:port")
REDIS_PWD Redis password.
Default: ""
REDIS_SENTINEL Whether you're using sentinel or not.
Default: ""
REDIS_MASTER_NAME Redis sentinel master name.
Default: ""
REDIS_LATENCY_THRESHOLD Redis latency threshold in ms.
When any command take longer than the threshold, then it sends data about latency. After PING_FREQUENCY has passed, it sends 0.
Default: ""
REDIS_METRICS_TO_WATCH The fields you want to keep track from the output of the command "info".
Default: "client_longest_output_list,connected_clients,blocked_clients,rejected_connections,instantaneous_input_kbps,instantaneous_output_kbps,instantaneous_ops_per_sec,keyspace_hits,keyspace_misses,mem_fragmentation_ratio,sync_full,sync_partial_ok,sync_partial_err"
LOGSTASH_HOST Y Logstash host
LOGSTASH_PORT Y Logstash port
LOGSTASH_PROTOCOL The transport protocol used by logstash.
Default: "udp"

Usage

REDIS_LATENCY_THRESHOLD="250" REDIS_HOST="localhost:6379" LOGSTASH_HOST="logstash.mine" LOGSTASH_PORT="8515" PROJECT="myapp" go run main.go

About

It retrieves metrics, periodically, from Redis (or sentinel) and send them to Logstash

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •