Skip to content

Commit 112b3c9

Browse files
committed
tank: add metrics property for exporter
1 parent 5ef9a34 commit 112b3c9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/warnet/graph_schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
"type": "boolean",
3434
"default": false,
3535
"comment": "Whether to attach a Prometheus data exporter to the tank"},
36+
"metrics": {
37+
"type": "string",
38+
"comment": "A space-separated string of RPC queries to scrape by Prometheus"},
3639
"collect_logs": {
3740
"type": "boolean",
3841
"default": false,

src/warnet/tank.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def __init__(self, index: int, warnet):
4949
self.bitcoin_config = ""
5050
self.netem = None
5151
self.exporter = False
52+
self.metrics = None
5253
self.collect_logs = False
5354
self.build_args = ""
5455
self.lnnode: LNNode | None = None
@@ -107,6 +108,9 @@ def parse_graph_node(self, node):
107108
else:
108109
raise Exception(f"Unsupported Lightning Network implementation: {options['impl']}")
109110

111+
if "metrics" in node:
112+
self.metrics = node["metrics"]
113+
110114
logger.debug(
111115
f"Parsed graph node: {self.index} with attributes: {[f'{key}={value}' for key, value in graph_properties.items()]}"
112116
)

0 commit comments

Comments
 (0)