Skip to content

Latest commit

 

History

History
 
 

collector-emitter

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Collector Client

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.

Prerequisites

apt-get install golang-go

Build

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.

Run locally or on a DC/OS node

./collector-emitter -h # view help
./collector-emitter -record-output-log # print records in json form

Get sent data

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