Open jukkar opened 1 day ago
I was too early to mark it ready, this needs more work.
I have to integrate network statistics to Prometheus. I glad to hear that pull request. I will put the comment after reviews. We can to be inspired 'node exporters'. Also it is good point to start. We can will integrate to each core libraries as windows/linux Prometheus 'node exporter' and after we can develop Zephyr node exporter Grafana template :)
I am wondering how the metrics should be named. The PR creates several metric for each network interface name, for example net_stats_eth_native_posix_0_0_bytes_recv_counter
where the network interface instance information is embedded to the metric name. But it seems that Prometheus expects the metric to be named something like net_stats_bytes_recv_counter
where the instance is not set in metric name. It seems that I should put the instance information to the label instead. @mustafaabdullahk is this a correct assumption?
Yep, you may put 'net_stats_bytes_recv_counter' and pass the network interfaces as label.
Further reading = Metric and label naming
Like following:
Ok, I will change the generated output to look like this then
# HELP zephyr_net_bytes_sent Bytes sent
# TYPE zephyr_net_bytes_sent counter
zephyr_net_bytes_sent{nic="eth_native_posix_0_0"} 7391
# HELP zephyr_net_bytes_recv Bytes received
# TYPE zephyr_net_bytes_recv counter
zephyr_net_bytes_recv{nic="eth_native_posix_0_0"} 1647
This allows network statistics to be exported via Prometheus.
Some of the Prometheus APIs are changed as they did not play very well with a real life example.