GithubHelp home page GithubHelp logo

happy-tanuki / mongo-redis-cloudwatch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brianantonelli/redis-cloudwatch

0.0 0.0 0.0 20 KB

Provides custom metrics for Mongo or Redis in AWS CloudWatch

Python 100.00%

mongo-redis-cloudwatch's Introduction

redis-cloudwatch

About

Provides custom metrics for Redis in AWS CloudWatch similar to those provided by Redis in Elasticache.

Prerequsites

This requires that you have installed Redis-Py, Boto and have created a Boto configuration file with your AWS credentials (~/.boto). You'll want to run this script as a cronjob every minute.

Install

sudo pip3 install boto redis
curl https://raw.githubusercontent.com/happy-tanuki/mongo-redis-cloudwatch/master/cw-redis-stats.py | sudo tee /usr/local/bin/cw-redis-stats.py
sudo chmod +x /usr/local/bin/cw-redis-stats.py
(crontab -l ; echo "* * * * * /usr/local/bin/cw-redis-stats.py")| crontab -

Metrics Captured

Metric Description Unit
CurrConnections The number of client connections, excluding connections from read replicas. Count
Evictions The number of keys that have been evicted due to the maxmemory limit. Count
Reclaimed The total number of key expiration events. Count
BytesUsedForCache The total number of bytes allocated by Redis. Bytes
CacheHits The number of successful key lookups. Count
CacheMisses The number of unsuccessful key lookups. Count
CurrItems The number of items in the cache. This is derived from the Redis keyspace statistic, summing all of the keys in the entire keyspace. Count
UsedMemory The memory in bytes used by the server. Count
IOPS The number of instantaneous ops per sec. Count
InputKbps The number of instantaneous input kbps. Count
OutputKbps The number of instantaneous output kbps. Count

Aggregated Command Metrics Captured

Metric Description Unit
GetTypeCmds The total number of get types of commands. This is derived from the Redis commandstats statistic by summing all of the get types of commands (get, mget, hget, etc.) Count
SetTypeCmds The total number of set types of commands. This is derived from the Redis commandstats statistic by summing all of the set types of commands (set, hset, etc.) Count
KeyBasedCmds The total number of commands that are key-based. This is derived from the Redis commandstats statistic by summing all of the commands that act upon one or more keys. Count
StringBasedCmds The total number of commands that are string-based. This is derived from the Redis commandstats statistic by summing all of the commands that act upon one or more strings. Count
HashBasedCmds The total number of commands that are hash-based. This is derived from the Redis commandstats statistic by summing all of the commands that act upon one or more hashes. Count
ListBasedCmds The total number of commands that are list-based. This is derived from the Redis commandstats statistic by summing all of the commands that act upon one or more lists. Count
SetBasedCmds The total number of commands that are set-based. This is derived from the Redis commandstats statistic by summing all of the commands that act upon one or more sets. Count
SortedSetBasedCmds The total number of commands that are sorted set-based. This is derived from the Redis commandstats statistic by summing all of the commands that act upon one or more sorted sets. Count
HyperLogLogBasedCmds The total number of commands that are hyperloglog-based. This is derived from the Redis commandstats statistic by summing all of the commands that act upon one or more hyperloglogs. Count
ScriptBasedCmds The total number of commands that are script-based. This is derived from the Redis commandstats statistic by summing all of the commands that act upon one or more scripts (eval, evalsha, etc). Count

mongo-cloudwatch

About

Provides custom metrics for Mongo in AWS CloudWatch.

Prerequsites

This requires that you have installed PyMongo, Boto and have created a Boto configuration file with your AWS credentials (~/.boto). You'll want to run this script as a cronjob every minute.

mongosh

db.createUser({
    user: "monitor",
    pwd: "changeme",
    roles: [
        "clusterMonitor"
    ]
})

Install

sudo pip3 install boto pymongo
curl https://raw.githubusercontent.com/happy-tanuki/mongo-redis-cloudwatch/master/cw-mongo-stats.py | sudo tee /usr/local/bin/cw-mongo-stats.py
sudo chmod 711 /usr/local/bin/cw-mongo-stats.py
(crontab -l ; echo "* * * * * /usr/local/bin/cw-mongo-stats.py")| crontab -

Metrics Captured

Metric Description Unit
CurrentConn Count
AvailableConn Count
CurrentQueue Count
ActiveClients Count
ConcurrentWrite Count
ConcurrentRead Count
MongoMemory Megabytes

mongo-redis-cloudwatch's People

Contributors

brianantonelli avatar happy-tanuki avatar e271828- avatar adamleyshon 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.