Tag values can be missing keys
Fix commands
Warn on invalid tag rather than drop
El-cheapo server that implements the ddtrace and dogstatsd protocols and blasts the data out to stdout.
Contains a server that can be run from the CLI, and also a standalone UDP server for dogstatsd and an HTTP handler for traces.
go run ./cmd/dogdump
Send some crap:
# Metrics
echo "fleeb:123:456:7.89|c|#a:b|T123|c:abc" >>/dev/udp/localhost/8125
# Logs
echo -e "foo\nbar\nbaz" \
| curl -i --data-binary @- \
-X POST \
-H 'Content-Type: text/plain' \
http://localhost:8127/api/v2/logs/
func metricHandler(ctx context.Context, m dogproto.Metric) error {
fmt.Println(m)
}
udpsrv, err := dogudp.Listen(ctx, dogudp.DefaultAddr, metricHandler, nil)
if err != nil {
return err
}
log.Printf("dogstats listening UDP:%s", metricsAddr)
return udpsrv.Serve()
This is a tool I hack on for my own amusement in an ad-hoc fashion. No stability guarantees are made, the code is not guaranteed to work, and anything may be changed, renamed or removed at any time as I see fit.
If you wish to use any of this, I strongly recommend you copy-paste pieces as-needed (including tests and license/attribution) into your own project, or fork it for your own purposes.
Bug reports are welcome, feature requests discouraged, and code contributions will not be accepted.