-
Notifications
You must be signed in to change notification settings - Fork 129
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
prom: Fix breakage due to msat purge #451
Conversation
Probably a red herring (ie. something I did wrong) but using this branch with v23.05.1 resulted in: Exception occurred during processing of request from ('127.0.0.1', 40712)
Traceback (most recent call last):
File \"/usr/lib/python3.11/socketserver.py\", line 691, in process_request_thread
self.finish_request(request, client_address)
File \"/usr/lib/python3.11/socketserver.py\", line 361, in finish_request
self.RequestHandlerClass(request, client_address, self)
File \"/usr/lib/python3.11/socketserver.py\", line 755, in __init__
self.handle()
File \"/usr/lib/python3.11/http/server.py\", line 432, in handle
self.handle_one_request()
File \"/usr/lib/python3.11/http/server.py\", line 420, in handle_one_request
method()
File \"/home/lightning/.local/lib/python3.11/site-packages/prometheus_client/exposition.py\", line 151, in do_GET
output = encoder(registry)
^^^^^^^^^^^^^^^^^
File \"/home/lightning/.local/lib/python3.11/site-packages/prometheus_client/exposition.py\", line 89, in generate_latest
for metric in registry.collect():
File \"/home/lightning/.local/lib/python3.11/site-packages/prometheus_client/registry.py\", line 75, in collect
for metric in collector.collect():
File \"/home/lightning/src/plugins/prometheus/prometheus.py\", line 52, in collect
[o['amount_msat'].to_satoshi() for o in funds['outputs']]
File \"/home/lightning/src/plugins/prometheus/prometheus.py\", line 52, in <listcomp>
[o['amount_msat'].to_satoshi() for o in funds['outputs']]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'int' object has no attribute 'to_satoshi' Guessing I am missing another change that would make |
Good catch, |
d84776c
to
f45e61c
Compare
Ok, finally found the time to fix this one up. Now the tests also create a channel and ensure that |
It's been a minute, but I think the error I mentioned above was actually due to the attr name change. I submitted a PR a few weeks ago #459 I still need to figure out how to run these internal tests, but they look pretty useful. |
Closes #450