erans / ec2instancespricing

Quick and dirty Python API and CLI to get EC2 instance pricing for On-Demand and Reserved Instances
Other
175 stars 89 forks source link

Adding statsd output format #57

Closed alexkruc closed 6 years ago

alexkruc commented 6 years ago

We wanted to put the pricing data in graphite in order of seeing time series data of it. I added the statsd output format to this script so we could just pass the output to netcat command and send it to our statsd server. We're triggering it using cron to statsd. I'm providing a usage example (that we are already using in our stack): ./ec2instancespricing.py --type all --filter-region eu-west-1 --filter-os-type linux --format statsd --statsd-prefix 'app.instancepricing' | nc -w 15 -u <statsd_host> 8125

Here is an output example (without the netcat command): app.instancepricing.eu-west-1.spot.h1_2xlarge:0.1833|g

We would be glad if you merge this change, we think it might be helpful to other people as well.

erans commented 6 years ago

Thanks. Looks like a cool implementation and interesting usage.