SketchLib provides API for implementing various sketching algorithms for network telemetry on programmable switch.
Project website.