Git Product home page Git Product logo

elasticache-slowlog-to-datadog's People

Contributors

jim80net avatar semantic-release-bot avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

opcity

elasticache-slowlog-to-datadog's Issues

Tune `SLOWLOG get` length and timing based on `slowlog-max-len`

If (SLOWLOG events per flush interval) > 10, then source data is being truncated, because the SLOWLOG get method returns 10 entries by default, configurable up to the slowlog-max-len parameter.

By default on AWS, slowlog_max_len is 128, however this is tuneable. Therefore, we want this to be tunable or dynamic here as well. CONFIG generally isn't available in Elasticache, so slowlog-max_len might need to be discovered through another means, perhaps by dynamically increasing the get length until the last entry index value (the first element of an entry) == 0.

if a SLOWLOG reset was performed, index 0 won't be available to us, so we'll have to watch for this case as well, and have a fallback mechanism for this, perhaps watching for the first entry to fall off. In addition, since we are a lambda job, we may startup after a rolloff has already occurred.

Recommendation: start with SLOWLOG get 128; look for index 0, or length < 128; else increase get length. If response length increases, repeat until it does not, or index 0 is found.

If the (SLOWLOG events per flush interval) exceed slowlog_max_len, then the source data will still be truncated. There are two approaches to resolve this. One is to reduce the flush interval. The flush interval is currently designed to be invoked from without, as a cloudwatch timer event. Adjusting this timer calls for re-architecture as a container. The other option is to create an independent collection interval and store flushable data in a buffer until the call is received.
Both approaches means adding an internal clock and call into question the need for the external clock (lambda).

Recommendation: add an internal clock and buffer to collect at a more frequent interval. Possibly, forgo the external clock entirely. Possibly rearchitect as a container.

When slowlog empty, undefined method `[]` for nil

Critical exception from handler
{
"errorMessage": "undefined method `[]' for nil:NilClass",
"errorType": "Function<NoMethodError>",
"stackTrace": [
"/var/task/lib/slowlog_check.rb:119:in `did_i_get_it_all?'",
"/var/task/lib/slowlog_check.rb:126:in `redis_slowlog'",
"/var/task/lib/slowlog_check.rb:132:in `slowlogs_by_flush_interval'",
"/var/task/lib/slowlog_check.rb:210:in `ship_slowlogs'",
"/var/task/lambda_function.rb:64:in `lambda_handler'"
]
}

did_i_get_it_all? should return true when []

Support for Cluster mode enabled elasticache instances

Two things, redis-rb needs to be connect with cluster mode, and parsing of the endpoint parameter needs to identify which mode to connect with.

An example of cluster-mode enabled configuration endpoint is:
blahblah-redis.abcdef.ab.1234.use2.cache.amazonaws.com

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.