This is a simple sampler for zipkin. It listens on a port and waits for spans to be sent to it. It collects the spans and sends them to the endpoint if the time of trace is greater than the time specified in the flag, otherwise it discards the trace.
go install github.com/eleven26/zipkin_sampler@v0.0.1
zipkin_sampler --port=9422 --endpoint=http://localhost:9411/api/v2/spans --time=5000
Flags:
--port
: The port to listen on (default 9422)--endpoint
: Zipkin server endpoint--time
: The minimum time of trace to send to zipkin server (default 5000, in milliseconds)