A small output plugin for statsd that facilitates the ingestion of incoming events to Azure Storage Append Blob. Includes a Dockerfile that builds statsd with this plugin on Alpine Linux.
Install Node.js on deb platforms
sudo npm install -g typescript
npm install
npm build # or tsc statsdtoazureblob.ts
# place the generated statsdtoazureblob.js on backends directory of statsd
A default statsd config.js
is provided for your convenience. It's installed in /etc/statsd/config.js
if you want to override it.
{
backends: ["../statsdtoazureblob/statsdtoazureblob"]
}
To run via Docker, you can use the below command:
docker run -p 8125:8125/udp -p 8126:8126 \
-e "BLOB_ACCOUNT=<YOUR_BLOB_ACCOUNT>" -e "BLOB_ACCOUNT_KEY=<YOUR_BLOB_ACCOUNT_KEY>" \
-e "REQ_HOSTNAME=$(hostname)" -e "BLOB_CONTAINER_NAME=<YOUR_CONTAINER_NAME>" \
--net=bridge --name statsd -d dgkanatsios/statsd-alpine:$VERSION
# get the container IP to pass it to the service that will send events to statsd
# if it's a container, it should be on the "bridge" network layer
STATSD_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' statsd)
Build
docker build -t dgkanatsios/statsd-alpine:$VERSION .
docker push dgkanatsios/statsd-alpine:$VERSION
# or
npm run dockerbuild && npm run dockerpush # make sure you change the version on package.json before running this!