Add prometheus metrics support #7
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Second cut at metrics server; now contains documentation update.
This was done with a great deal of AI assistance, although I've also hand-edited a lot of the results. I've included the base level prompts I used to kickstart the AI in the
plans/directory. Hopefully they describe fairly clearly what I was aiming for (although after viewing the results I've changed those requirements somewhat). I've squashed the commits, but if you want to see the ugly details I can push an unsquashed branch instead.I'm not entirely happy with the tests, but it's ready enough to try. I don't really have any great way of load testing it to see the performance effects of enabling metrics, but it is surviving on my pool host without blowing up: https://www.ntppool.org/scores/2001:44b8:2100:3f00::7b:502
I'd be interested in your opinion, @mlichvar, on what the best histogram buckets for packet size might be. My feeling that the <48,<56,<128,128+ divide is a little oversimplified, but I'm not sure what the other options should be since I'm really only seeing generic requests from IPv6-capable hosts on my pool server.
I've put release binaries on my fork of the repo if anyone wants to test them. The binary is 1.9M on my system, as opposed to about 670K for the master branch build. The memory requirements for enabling client cache are significant, but on my system they appear to have no perceptible effect on CPU usage.