Skip to content

Commit

Permalink
remove connect_logging and update monitoring docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pinheadmz committed Sep 12, 2024
1 parent a34db27 commit d6473fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 48 deletions.
7 changes: 4 additions & 3 deletions docs/logging_monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ aggregate logs and data from Bitcoin RPC queries into a web-based dashboard.
## Connect to logging dashboard

The logging stack including the user interface web server runs inside the kubernetes cluster.
To access that from a local web browser, you must use kubernetes port-forwarding.
Warnet will forward port `2019` locally from the cluster, and the landing page for all
web based interfaces will be available at `localhost:2019`.

This page can also be opened quickly with the command [`warnet dashboard`](/docs/warnet.md#warnet-dashboard)

Run the script `./resources/scripts/connect_logging.sh` to forward port 3000.
The Grafana dashboard will then be available locally at `localhost:3000`.

### Prometheus

Expand Down
17 changes: 0 additions & 17 deletions resources/scripts/connect_logging.sh

This file was deleted.

29 changes: 1 addition & 28 deletions test/logging_test.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#!/usr/bin/env python3

import logging
import os
import threading
from datetime import datetime
from pathlib import Path
from subprocess import PIPE, Popen

import requests
from test_base import TestBase
Expand All @@ -18,39 +15,15 @@ def __init__(self):
super().__init__()
self.network_dir = Path(os.path.dirname(__file__)) / "data" / "logging"
self.scripts_dir = Path(os.path.dirname(__file__)) / ".." / "resources" / "scripts"
self.connect_logging_process = None
self.connect_logging_thread = None
self.connect_logging_logger = logging.getLogger("cnct_log")

def run_test(self):
try:
self.setup_network()
self.start_logging()
self.wait_for_endpoint_ready()
self.test_prometheus_and_grafana()
finally:
if self.connect_logging_process is not None:
self.log.info("Terminating background connect_logging.sh process...")
self.connect_logging_process.terminate()
self.cleanup()

def start_logging(self):
# Stays alive in background
self.connect_logging_process = Popen(
[f"{self.scripts_dir / 'connect_logging.sh'}"],
stdout=PIPE,
stderr=PIPE,
bufsize=1,
universal_newlines=True,
)
self.log.info("connect_logging.sh started...")
self.connect_logging_thread = threading.Thread(
target=self.output_reader,
args=(self.connect_logging_process.stdout, self.connect_logging_logger.info),
)
self.connect_logging_thread.daemon = True
self.connect_logging_thread.start()
self.wait_for_endpoint_ready()

def setup_network(self):
self.log.info("Setting up network")
self.log.info(self.warnet(f"deploy {self.network_dir}"))
Expand Down

0 comments on commit d6473fe

Please sign in to comment.