Skip to content
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

warnet init: add metricsExport:true if grafana is selected #707

Merged
merged 1 commit into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/warnet/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def custom_graph(

# Configure logging
defaults_yaml_content["collectLogs"] = logging
defaults_yaml_content["metricsExport"] = logging

with open(os.path.join(datadir, "node-defaults.yaml"), "w") as f:
yaml.dump(defaults_yaml_content, f, default_flow_style=False, sort_keys=False)
Expand Down
20 changes: 12 additions & 8 deletions test/graph_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ def directory_exists(self):
try:
self.log.info("testing warnet create, dir does exist")
self.sut = pexpect.spawn("warnet create")
self.sut.expect("name", timeout=10)
self.sut.expect("name", timeout=30)
self.sut.sendline("ANewNetwork")
self.sut.expect("many", timeout=10)
self.sut.expect("many", timeout=30)
self.sut.sendline("")
self.sut.expect("connections", timeout=10)
self.sut.expect("connections", timeout=30)
self.sut.sendline("")
self.sut.expect("version", timeout=10)
self.sut.expect("version", timeout=30)
self.sut.sendline("")
self.sut.expect("enable fork-observer", timeout=10)
self.sut.expect("enable fork-observer", timeout=30)
self.sut.sendline("")
self.sut.expect("seconds", timeout=10)
self.sut.sendline("")
self.sut.expect("enable grafana", timeout=10)
self.sut.expect("seconds", timeout=30)
self.sut.sendline("")
self.sut.expect("enable grafana", timeout=30)
self.sut.sendline("true")
self.sut.expect("successfully", timeout=50)
except Exception as e:
print(f"\nReceived prompt text:\n {self.sut.before.decode('utf-8')}\n")
Expand All @@ -74,6 +74,10 @@ def run_created_network(self):
assert debugs["mempool"]
# santy check
assert not debugs["zmq"]
# verify that prometheus exporter is making its rpc calls
self.wait_for_predicate(
lambda: "method=getblockcount user=user" in self.warnet("logs tank-0000")
)


if __name__ == "__main__":
Expand Down
Loading