fix(prometheus): flaky metrics server #608
Merged
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.
Problems
Prometheus does not consistently get metrics from our metrics endpoint. The metrics are intermittent.
Also, the server often crashes due to errors. In #590 I added a wrapper to catch these errors and restart the server. But sometimes an error occurs that is handled, a server restart is attempted, but the server never responds to any http requests any more, so the metrics become completely inaccessible until sig is completely restarted. Usually this is caused by
error.BrokenPipe
Solution
I understand the desire to eliminate unnecessary dependencies. In the grand scheme of things, eliminating httpz is not that important. Having a working metrics endpoint is critical though. We have a solution that works with httpz. We should test more thoroughly before replacing it.