New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3786 Add OpenMetrics (Prometheus) statistics endpoint #1125
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Some comments left inline.
Was: > TypeError: unbound method render_OPENMETRICS() must be called with Statistics instance as first argument (got FakeStats instance instead)
Uff
[...]
Is this a classic class? |
I guess it is because twisted.web.resource.Resource is. Mix in |
Ah thanks! I had hoped it was this easy :) |
d'uh! I wanted to close the conversation thread, not the PR of course :( |
The Linter complains: > 'testtools.matchers.Always' imported but unused
trailing whitespace
@exarkun please update the ticket status (the pending re-review) if you are good with this as it stands - I don't have the authority to do it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this now (also I am an author on some of it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good.
I find the test a little hard to follow .. since it only asserts a single thing in the end, maybe the "fake stats" could also just include that one thing? On the plus side, it does say how to re-create the huge dict. :)
Super minor nit, but could render_OPENMETRICS
just be render_openmetrics
or is there a need/reason for the all-uppercase?
Hi @meejah! Thank you for your review and feedback!
The other methods like that one are named similarly and this code makes it look like that specific part of the name should be upper cased. |
The real check is that The check for |
FWIW I think the complexity of the test follows from the complexity of Tahoe's implementation of metrics collection. There is very little structure in the metrics Tahoe is gathering - mostly they are free-form strings associated with with a (probably) number. The test has no way to automatically collect all real metrics from the codebase (the only way to get them is to run Tahoe and make sure you hit every metrics-generating codepath). A great future cleanup could be introducing some more structure in the metrics gathering code. This could have a specific goal (among others) of allowing tests to easily verify all metrics that are reported can be exported into the necessary format. @meejah gave an approval along with this comment which I would interpret to mean "it would be nice to improve this area but it is not required before merging". I think we should go ahead and merge this with the complex test and as there is motivation to further Tahoe metrics improvements, we can incrementally improve the factoring and testing. |
Yes, my comments (along with the "approve") was meant to mean, "here are things I was slightly confused about, update or not then merge". Hopefully I'm not screwing anything up by just merging this now since it seems ready-to-go... |
Fixes https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3786