Giter Club home page Giter Club logo

chef_opentsdb_handler's Introduction

opentsdb_handler Cookbook

This cookbook sets up a handler that reports to OpenTSDB at the end of a chef run

Requirements

The only requirement is the chef_handler cookbook

Attributes

Key Type Description Default
['opentsdb_handler']['metrics'] Hash this is where each metric to be sent is defined as { unique_name => metric_hash } {}
['opentsdb_handler']['metric'][unique_name]['name'] String Metric name None
['opentsdb_handler']['metrics'][unique_name]['value'] Hash Value of metric None
['opentsdb_handler']['metrics'][unique_name]['tags'] Hash Key => Value hash of tags for the metric. {'hostname' => Socket.gethostname}(IN HANDLER SCRIPT)
['opentsdb_handler'][handler_name]['run_status_tag'] Boolean Will add run_status=0|1 (success, failure respectively) tag if true false
['opentsdb_handler']['run_status']['elapsed_time'|'start_time'|'end_time'] Boolean Will send a metric of the chef.elapsed_time (or start_time or end_time) if true. Change tags on ['handlers']['elapsed_time']['tags'] false
['opentsdb_handler']['hostname'] opentsdb Hostname of OpenTSDB server opentsdb (IN HANDLER SCRIPT)
['opentsdb_handler']['port'] Integer Port of OpenTSDB server 4242 (IN HANDLER SCRIPT)
['opentsdb_handler']['timeout'] Integer Timeout before failing to send to metric 10 (IN HANDLER SCRIPT)

Usage

opentsdb_handler::default

Include opentsdb_handler in your node's run_list and add the following attributes:

node.default['opentsdb_hander']['metrics']['flying_puppy_metric']['name'] = 'flying_puppy.metric'
node.default['opentsdb_hander']['metrics']['flying_puppy_metric']['value'] = 10
# Optional
node.default['opentsdb_hander']['metrics]['flying_puppy_metric']['tags'] = {"breed" => "corgi"}

You can add as many metrics to this hash as you want. The timestamp will be created at the start of the handler.

Contributing

  1. Fork the repository on Github
  2. bundle install
  3. Make changes
  4. Test your changes Testing

Testing

Integration tests are run with test-kitchen, kitchen-vagrant, and serverspec for integration testing. You can take a look at [.kitchen.yml] for how tests are set up. Run with:

rake kitchen:all

Unit testing is run with ChefSpec

Linting is done with foodcritic and rubocop

Run unit and linting with:

rake test

License and Authors

Authors: [email protected]

chef_opentsdb_handler's People

Contributors

mi-wood avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

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.