add more matching
This commit is contained in:
@@ -6,6 +6,7 @@ from pathlib import Path
|
||||
|
||||
from .config import ConfigStore
|
||||
from .graylog_mcp import GraylogMcpClient
|
||||
from .metrics import prometheus_metrics
|
||||
|
||||
|
||||
HTML = """<!doctype html>
|
||||
@@ -241,6 +242,13 @@ def serve_dashboard(host: str, port: int, status_file: str, *, image_dir: str |
|
||||
body = json.dumps({"summary": {}, "anomalies": [], "block_candidates": []}).encode("utf-8")
|
||||
self._send(200, "application/json", body)
|
||||
return
|
||||
if self.path == "/metrics":
|
||||
try:
|
||||
status = json.loads(status_path.read_text(encoding="utf-8")) if status_path.exists() else {}
|
||||
except json.JSONDecodeError:
|
||||
status = {}
|
||||
self._send(200, "text/plain; version=0.0.4; charset=utf-8", prometheus_metrics(status).encode("utf-8"))
|
||||
return
|
||||
if self.path.startswith("/images/") and image_root:
|
||||
image_path = image_root / Path(self.path).name
|
||||
if image_path.exists() and image_path.is_file():
|
||||
|
||||
Reference in New Issue
Block a user