Skip to content

Telmate/json2dog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json2dog

Send JSON data from a URL to datadog.

Supported Platforms

  • Ubuntu or CentOS

Usage

# to get our copy of DataDog::DogStatsd
cd lib
export PERL5LIB=`pwd`
cd ..

./json2dog health_url statsd_base Jmes_path

where

  • health_url is a URL to a JSON end point that returns stats we should graph
  • statsd_base is the start of the metric name that should be sent to datadog
  • Jmes_path is Json XPath like string that is passed to extract specific parameters from JSON string. if no string is passed the default Xpath string value is set to @(root) which passes the entire JSON string(http://jmespath.org/tutorial.html)

Options can be set by setting environment variables:

# set port for dogstatsd (optional)
export DOGSTATSD_PORT=8125

# enable debug mode
export JSON2DOG_DEBUG=1

# log to a file
export JSON2DOG_LOG=/var/log/json2dog.log

./json2dog health_url statsd_base Jmes_path

Other options are used by the init scripts and are documented here.

Dependencies

  • Perl 5
  • Perl module DataDog::DogStatsd is included
  • Perl module JSON
  • Perl module IO::Handle (core module)
  • Perl module IO::Socket::SSL
  • Perl module LWP::UserAgent
  • Perl module Jmespath

The two standard Perl modules mentioned above can be installed my running prereq.sh.

Sample Results

example 1

Support

Please file tickets via github issues.

You may find the CHANGELOG helpful.

Authors

About

Send JSON data from a URL to datadog.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •