A reference implementation of a system process which emits Avro Metrics data to a Collector.
- Connects to
127.0.0.1:8124
and sends various arbitrary data to it. - Automatically recovers if the connection is lost.
apt-get install golang-go
go generate # creates 'metrics_schema' package
go build
If you see errors about cannot find package "github.com/.../metrics_schema"
, you forgot to perform go generate
.
./collector-emitter -h # view help
./collector-emitter -record-output-log # print records in json form
nc -l 8124
can be run on the same system to view raw emitted data or save it to disk.
The data will follow the standard Avro OCF format and can be directly parsed using avro-tools.jar:
nc -l 8124 > data.avro
# <send some stats, then close collector-emitter process to close nc>
java -jar avro-tools-1.8.0.jar getschema data.avro
java -jar avro-tools-1.8.0.jar tojson --pretty data.avro