package
0.0.0-20190227035732-d56806e5335b
Repository: https://github.com/dcos/dcos-metrics.git
Documentation: pkg.go.dev
# README
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 get -u github.com/dcos/dcos-metrics
cd $GOPATH/src/github.com/dcos/dcos-metrics/examples/collector-emitter/
go generate # creates 'metrics_schema' package
go build # local native build
CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags="-s -w" -o collector-emitter-linux # linux build (for clusters)
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