Code Monkey home page Code Monkey logo

redis-healthy's Introduction

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

redis-healthy's People

Contributors

leandromoreira avatar lucasmundim avatar lucasrodcosta avatar vdbalbom avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.