feat: Add interactive ClickHouse cluster topology visualization#84
feat: Add interactive ClickHouse cluster topology visualization#84
Conversation
Features: - Backend: New /api/clusters/topology endpoint with comprehensive topology data - Queries system.clusters, system.replicas, system.tables, and system.parts - Returns cluster structure, replication status, and table metadata - Frontend: Interactive graph visualization using @antv/graphin - Three view modes: Cluster Topology, Tables & Databases, Combined View - Hierarchical graph showing clusters → shards → replicas - Database and table visualization with replication indicators - Color-coded health status (green: healthy, yellow: slowdowns, red: errors) - Click-to-expand node details in sidebar drawer - Supports multiple clusters with dropdown selector - Dependencies: Added @antv/g6 (5.0.50) and @antv/graphin (3.0.5) for graph rendering This view enables ops teams to quickly understand their ClickHouse cluster architecture, identify unhealthy nodes, and visualize data distribution.
Wiz Scan Summary
|
| Scanner | Findings |
|---|---|
| 21 |
|
| - | |
| - | |
| - | |
| - | |
| Total | 21 |
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.
| ) | ||
| except Exception as e: | ||
| logger.error("topology_error", error=str(e)) | ||
| return Response({"error": str(e)}, status=500) |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 5 months ago
To fix the problem, modify the response sent to the user in the except block so that it does not include details from the exception object—just a generic message like {"error": "An internal error has occurred."}. Retain detailed error information in logs using logger.error, which already records the stringified exception (optionally, logging the traceback if desired). Only generic and non-sensitive information should be returned to API consumers.
No changes to the functionality are needed except for the API error message in the except block (lines 63) of the topology method in housewatch/api/cluster.py. No new imports are required, as logger is already set up. No additional package installations are needed.
| @@ -60,4 +60,4 @@ | ||
| ) | ||
| except Exception as e: | ||
| logger.error("topology_error", error=str(e)) | ||
| return Response({"error": str(e)}, status=500) | ||
| return Response({"error": "An internal error has occurred."}, status=500) |
Features:
Backend: New /api/clusters/topology endpoint with comprehensive topology data
Frontend: Interactive graph visualization using @antv/graphin
Dependencies: Added @antv/g6 (5.0.50) and @antv/graphin (3.0.5) for graph rendering
This view enables ops teams to quickly understand their ClickHouse cluster architecture, identify unhealthy nodes, and visualize data distribution.