mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-24 08:34:18 +01:00
@@ -32,7 +32,11 @@ class NodeCollector(BaseLnCollector):
|
||||
value=blockheight,
|
||||
)
|
||||
|
||||
fees_msat = info["msatoshi_fees_collected"]
|
||||
print(info)
|
||||
fees_msat = int(info.get(
|
||||
"fees_collected_msat",
|
||||
info.get("msatoshi_fees_collected", None)
|
||||
))
|
||||
yield GaugeMetricFamily(
|
||||
'lightning_fees_collected_msat',
|
||||
'How much have we been paid to route payments?',
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
from pyln.testing.fixtures import * # noqa: F401,F403
|
||||
import urllib
|
||||
|
||||
plugin_path = os.path.join(os.path.dirname(__file__), "prometheus.py")
|
||||
|
||||
@@ -14,3 +15,13 @@ def test_prometheus_starts(node_factory):
|
||||
# Then statically
|
||||
l1.daemon.opts["plugin"] = plugin_path
|
||||
l1.start()
|
||||
|
||||
|
||||
def test_prometheus_scrape(node_factory):
|
||||
"""Test that we can scrape correctly.
|
||||
"""
|
||||
l1 = node_factory.get_node(options={'plugin': plugin_path})
|
||||
scrape = urllib.request.urlopen("http://localhost:9750")
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user