Send JSON data from a URL to datadog.
- Ubuntu or CentOS
# 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 graphstatsd_base
is the start of the metric name that should be sent to datadogJmes_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.
- 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
.
Please file tickets via github issues.
You may find the CHANGELOG helpful.
- Christopher Hicks [email protected]