HouseWatch

HouseWatch

开源ClickHouse集群监控与管理工具

HouseWatch是专为ClickHouse集群开发的开源监控管理工具。它提供集群负载和性能概览、查询分析、日志搜索功能,支持监控和终止运行中的查询,分析磁盘使用情况,并具备直观的查询界面。该工具还能进行后台操作管理,自动回滚失败操作,有助于ClickHouse用户优化集群性能和解决问题。

ClickHouse监控工具性能分析集群管理开源项目Github
<p align="center"> <img src="./banner-light.png"> </p> <p align="center"> <img src="./overview.png"> </p>

📈 Open source tool for monitoring and managing ClickHouse clusters

  • Get an overview of cluster load and performance
  • Drill down into your queries and understand the load they put on your cluster
  • Search through logs and errors
  • Monitor and kill running queries with the click of a button
  • Get stats on your disk usage per node, and understand how much disk space tables, columns, and parts take up
  • Run your own queries straight from the interface to further dig into performance and cluster issues
  • Setup operations to run in the background with automatic rollbacks for failures

💻 Deploy

To deploy HouseWatch, clone this repo and then run the following, substituting the environment variables for the relevant values of one of your ClickHouse instances:

SITE_ADDRESS=<SITE_ADDRESS> \ CLICKHOUSE_HOST=localhost \ CLICKHOUSE_CLUSTER=mycluster \ CLICKHOUSE_USER=default \ CLICKHOUSE_PASSWORD=xxxxxxxxxxx \ docker compose -f docker-compose.yml up

SITE_ADDRESS here is the address that the UI will be running on. It can be a domain name or simply a port like :80.

After running the above, the UI will be running on the address you specified. This will be something like http://localhost if you used :80 for your SITE_ADDRESS above. I would think twice about exposing this to the internet, as it is not currently secured in any way.

<details> <summary>Read more</summary> <br />

The following are the supported environment variables for configuring your HouseWatch deployment:

  • CLICKHOUSE_HOST: Required - hostname of the instance to connect to.
  • CLICKHOUSE_USER: Required - username to access ClickHouse. Can be a read-only user, but in that case not all features will work.
  • CLICKHOUSE_PASSWORD: Required - password for the specified user.
  • CLICKHOUSE_DATABASE: Optional - database to connect to by default.
  • CLICKHOUSE_CLUSTER: Optional - cluster name, to analyze data from the whole cluster.
  • CLICKHOUSE_SECURE: Optional - see clickhouse-driver docs for more information
  • CLICKHOUSE_VERIFY: Optional - see clickhouse-driver docs for more information
  • CLICKHOUSE_CA: Optional - see clickhouse-driver docs for more information
  • OPENAI_API_KEY: Optional - enables the experimental "AI Tools" page, which currently features a natural language query editor
  • OPENAI_MODEL: Optional - a valid OpenAI model (e.g. gpt-3.5-turbo, gpt-4) that you have access to with the key above to be used for the AI features
</details>

🏡 Running locally

To run HouseWatch locally along with a local ClickHouse instance, execute:

docker compose -f docker-compose.dev.yml up -d

then go to http://localhost:8080

💡 Motivation

At PostHog we manage a few large ClickHouse clusters and found ourselves in need of a tool to monitor and manage these more easily.

ClickHouse is fantastic at introspection, providing a lot of metadata about the system in its system tables so that it can be easily queried. However, knowing exactly how to query and parse the available information can be a difficult task. Over the years at PostHog, we've developed great intuition for how to debug ClickHouse issues using ClickHouse, and HouseWatch is the compilation of this knowledge into a tool.

Beyond monitoring, we also built internal systems and processes for managing the clusters that spanned various platforms. We would use Grafana to look at metrics, SSH into nodes for running operations and using specialized tooling, query via Metabase to dig deeper into the data in the system tables and create dashboards, and then a combination of tools baked into the PostHog product for further debugging and streamlined operations such as our async migrations tool, and internal views for listing queries and analyzing their performance.

As a result, we felt it was appropriate to have these tools live in one place. Ultimately, our vision for HouseWatch is that it can both serve the purpose of a pganalyze for the ClickHouse ecosystem, while also including tooling for taking action on insights derived from the analysis.

🏗️ Status of the project

HouseWatch is in its early days and we have a lot more features in mind that we'd like to build into it going forward. The code could also use some cleaning up :) As of right now, it is considered Beta software and you should exercise caution when using it in production.

One potential approach is to connect HouseWatch to ClickHouse using a read-only user. In this case, the cluster management features will not work (e.g. operations, query editor), but the analysis toolset will function normally.

HouseWatch was created and is maintained by PostHog and yakkomajuri.

ℹ️ Contributing

Contributions are certainly welcome! However, if you'd like to build a new feature, please open up an issue first.

⭐ Features

<h2 align="center">Query performance</h3> <div style="display: flex"> <img src="./slow-queries.png" width="48%"> <img src="./normalized-query.png" width="48%"> </div> <div style="display: flex"> <img src="./query-stats.png" width="48%"> <img src="./explain.png" width="48%"> </div> <br /> <h2 align="center">Schema stats</h3> <div style="display: flex"> <img src="./schema.png" width="48%"> <img src="./schema-drilldown.png" width="48%"> </div> <br /> <h2 align="center">Query benchmarking</h3> <div style="display: flex"> <img src="./benchmark1.png" width="48%"> <img src="./benchmark2.png" width="48%"> </div> <br /> <h2 align="center">Logs</h3> <p align="center"> <img src="./logs.png" align="center"> </p> <br /> <h2 align="center">Query editor</h3> <p align="center"> <img src="./query-editor.png"> </p> <br /> <h2 align="center">Disk usage</h3> <p align="center"> <img src="./disk-usage.png"> </p> <br /> <h2 align="center">Errors</h3> <p align="center"> <img src="./errors.png"> </p> <br /> <h2 align="center">Operations</h3> <p align="center"> <img src="./operations.png"> </p>

🗒️ To-do list

A public list of things we intend to do with HouseWatch in the near future.

<details> <summary>See list</summary> <br />

<b>Features</b>

  • System issues tab
  • EXPLAIN visualizer
  • Multiple instance support
  • Stats on page cache hit percentage
  • Make operations resilient to Celery going down (as we do in PostHog with async migrations)
  • Read-only mode
  • Button to force refresh running queries list
  • Logs pagination
  • Allow copying example queries
  • Configurable time ranges
  • Whole cluster schema stats
  • More operation controls: view, delete, edit, re-run, display errors

<b>Developer experience</b>

  • Configure instance from UI
  • Publish a Docker image
  • Development docker-compose.yml with baked in ClickHouse

<b>Cleanup</b>

  • Extract README images out of repo
  • Make banner subtitle work on dark mode
  • Fetch data independently on the query analyzer
  • Breakpoint for logs search
  • Run Django "production server"
  • Write tests :)
  • Query editor pipe all errors to client
  • Abstraction to load data from API as JSON
</details>

编辑推荐精选

Vora

Vora

免费创建高清无水印Sora视频

Vora是一个免费创建高清无水印Sora视频的AI工具

Refly.AI

Refly.AI

最适合小白的AI自动化工作流平台

无需编码,轻松生成可复用、可变现的AI自动化工作流

酷表ChatExcel

酷表ChatExcel

大模型驱动的Excel数据处理工具

基于大模型交互的表格处理系统,允许用户通过对话方式完成数据整理和可视化分析。系统采用机器学习算法解析用户指令,自动执行排序、公式计算和数据透视等操作,支持多种文件格式导入导出。数据处理响应速度保持在0.8秒以内,支持超过100万行数据的即时分析。

AI工具使用教程AI营销产品酷表ChatExcelAI智能客服
TRAE编程

TRAE编程

AI辅助编程,代码自动修复

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

热门AI工具生产力协作转型TraeAI IDE
AIWritePaper论文写作

AIWritePaper论文写作

AI论文写作指导平台

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

数据安全AI助手热门AI工具AI辅助写作AI论文工具论文写作智能生成大纲
博思AIPPT

博思AIPPT

AI一键生成PPT,就用博思AIPPT!

博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。

热门AI工具AI办公办公工具智能排版AI生成PPT博思AIPPT海量精品模板AI创作
潮际好麦

潮际好麦

AI赋能电商视觉革命,一站式智能商拍平台

潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。

iTerms

iTerms

企业专属的AI法律顾问

iTerms是法大大集团旗下法律子品牌,基于最先进的大语言模型(LLM)、专业的法律知识库和强大的智能体架构,帮助企业扫清合规障碍,筑牢风控防线,成为您企业专属的AI法律顾问。

SimilarWeb流量提升

SimilarWeb流量提升

稳定高效的流量提升解决方案,助力品牌曝光

稳定高效的流量提升解决方案,助力品牌曝光

Sora2视频免费生成

Sora2视频免费生成

最新版Sora2模型免费使用,一键生成无水印视频

最新版Sora2模型免费使用,一键生成无水印视频

下拉加载更多