go-libp2p
go-libp2p copied to clipboard
quic: make metrics collection independent of Prometheus' scrape frequency
Looping over the connections on a fixed interval would make the data returned to Prometheus independent of its scrape interval and the amount of Prometheus instances. E.g. if you have 3 Prometheus instances for high availability, you would be looping over the connections 3 times every scrape interval (e.g. minute). Instead, if you collect on a fixed interval (e.g. 1 minute) you would only loop over all collections once per minute, instead of 3 times per minute.
I think it is fine either way.
Originally posted by @mxinden in https://github.com/libp2p/go-libp2p-quic-transport/pull/200#discussion_r606964540
Open question: Is there any way to find out Prometheus' scrape frequency, so we can adjust our collection interval?
Open question: Is there any way to find out Prometheus' scrape frequency, so we can adjust our collection interval?
Not that I am aware of, other than guessing it based on previous scrapes, though I would consider that a hack.