Archived - https://github.com/0xb10c/peer-observer does something similar
An experimental Prometheus metric exporter for Bitcoin Core based on Userspace, Statically Defined Tracing and eBPF.
This demo is based on code released in Bitcoin Core version 23.0.
The bitcoind-observer is written in Rust and open source. Code can be found on github.com/0xb10c/bitcoind-observer.