- Collector — queries ClickHouse with pagination and worker pool
- Analyzer — processes query logs to build data models
- Scorer — evaluates tables for cleanup safety
- Reporter — generates JSON+HTML, text, or SARIF outputs
- K8s Resolver — (optional) resolves IPs to Kubernetes services
report/
├── report.txt # Human-readable report (--format text)
├── report.sarif # SARIF output (--format sarif)
├── report.json # Structured data (--format json)
├── index.html # Interactive UI (--format json)
├── app.js # Application logic (--format json)
├── styles.css # Styling (--format json)
└── libs/
└── d3.v7.min.js # D3.js library (--format json)
- Overview — summary statistics (tables, services, queries, anomalies)
- Graph — D3.js bipartite graph visualization (service-to-table relationships)
- Tables — sortable table list with usage stats and sparklines
- Services — list of services and their table usage
- Cleanup — categorized recommendations:
- Zero Usage Non-Replicated (High Priority)
- Zero Usage Replicated (Review Carefully)
- Safe to Drop / Likely Safe / Keep
- Anomalies — detected unusual access patterns
- Analyzes
system.query_logto find which tables were queried - Queries
system.tablesto get complete table inventory - Compares the two to identify tables with zero usage
- Separates replicated vs non-replicated tables
- Filters by size to focus on tables worth cleaning up
Resolves ClickHouse client IPs to Kubernetes service names. If ClickHouse sits behind a load balancer, enable PROXY protocol to get real client IPs.
See ClickHouse Real Client IP and Kubernetes Resolution for setup guides.
# One-command deployment
clickspectre deploy ./my-report --namespace monitoring --port 8080Creates namespace, ConfigMap from report files, nginx deployment, Service, and port-forward.
For custom domain access:
clickspectre deploy ./my-report --namespace production --ingress-host clickspectre.example.comSee k8s/README.md for manual deployment and CronJob examples.