markormesher / iperf-prometheus-collector

GNU Affero General Public License v3.0
4 stars 2 forks source link

new iperf_sent_bytes_total and iperf_received_bytes_total counters #34

Open gberche-orange opened 1 month ago

gberche-orange commented 1 month ago

As a user, given test duration (say 10s) might smaller than scrape time (1 min by default), in order to know precisely how much data was transfered by all cumulative iperf runs by target I need new counters iperf_sent_bytes_total and iperf_received_bytes_total with labels target

markormesher commented 1 month ago

I'm not sure about this one - I can't imagine wanting to run a test more often than the scrape interval. The duration of the test being less than the scrape interval shouldn't be a problem - the total data sent and duration are available as metrics.

gberche-orange commented 1 month ago

In the context of my project in my company, we run 72 exporters for a wide combination of data center availability zones, protocol (udp/tcp), public vs private ip addresses etc... Network operators are concerned about bugs in the iperf infrastructure that would overload the network infrastructure and impact customer facing services.

I can't imagine wanting to run a test more often than the scrape interval.

This might happen as a bug in the automated deployment of the iperf exporter. In my case, I'm authoring a helm release which loops among the az/protocol/interfaces and provisions iperf exporter and iperf listeners.

Being able to rely on iperf_sent_bytes_total and iperf_received_bytes_total counters for iperf client would be quite useful, especially in the context of sporadic metric discussed in https://github.com/markormesher/iperf-prometheus-collector/issues/25#issuecomment-2435606866

Thinking it through, it would be even better to publish these metrics from the iperf server instead of the iperf client, as iperf server already compute them. I yet have to test the latest iperf server version supporting the -S --json-stream option documented at https://github.com/esnet/iperf/blob/master/docs/invoking.rst In the perf3 version coming with ghcr.io/markormesher/iperf-prometheus-collector:v0.3.0-rc3, this option does not seem supported

   --json-stream
          output in line-delimited JSON format
root@d8208281-d1cd-4762-9716-ee428dca2660:/app# iperf3 -v                   
iperf 3.12 (cJSON 1.7.15)                          
Linux d8208281-d1cd-4762-9716-ee428dca2660 5.15.0-119-generic #129-Ubuntu SMP Fri Aug 2 19:25:20 UTC 2024 x86_64
Optional features available: CPU affinity setting, IPv6 flow label, SCTP, TCP congestion algorithm setting, sendfile / zerocopy, socket pacing, authentication, bind to device, support IPv4 don't fragment

root@d8208281-d1cd-4762-9716-ee428dca2660:/app# iperf3 -s --json-stream                                   
iperf3: unrecognized option '--json-stream'                                                              
Usage: iperf3 [-s|-c host] [options]                                                                     
iperf3 [-h|--help] [-v|--version]