vpnkit
vpnkit copied to clipboard
Export stats to a time-series database
Since we're on the network data path we can measure the traffic as it passes through. We could measure
- packets per second
- bytes per second
- DNS requests latency
- DNS request failure rate
- Number of active UDP NAT rules etc
This data could be sent to an external time-series database such as influxdb and then visualised.
This involves
- writing a client for a time-series database (this may be as easy as
connect()ing to it and writing.jsonmessages) - adding some basic counters to the network stack
- (stretch goal): allow the user to define their own filters via datakit and record these too
From Prometheus it's really quite simple, you'd only need to expose and HTTP /metrics endpoint, see docs about format.
@djs55 have you seen https://github.com/mirage/prometheus ?
Note: It's already being used in DatakitCI courtesy of https://github.com/mirage/prometheus