Clickhouse Logs Queries
supabase/supabase
Write, review, and migrate Supabase logs queries against the ClickHouse-backed logs table (the logs.all.otel analytics endpoint).
Wavelet 项目专用:当新增或修改 ClickHouse 批量写入、接入 internal/infra/persistence/batchwriter、将业务域异步 flush 到分析表、迁移 riskcontrol/节点访问日志/可观测时序写入、或评估 asyncinsert 与背压策略时必须使用。本技能指导分层职责、各域独立 Writer 实例、repository 批量 API…
$ npx skills add Rain-kl/OpenFlare --skill clickhouse-batchwriter -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install Rain-kl/OpenFlare clickhouse-batchwriter --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/Rain-kl/OpenFlare.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/clickhouse-batchwriter .claude/skills/clickhouse-batchwriter && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "clickhouse-batchwriter" agent skill from https://github.com/Rain-kl/OpenFlare/tree/main/.agents/skills/clickhouse-batchwriter into .claude/skills/clickhouse-batchwriter/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "clickhouse-batchwriter", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/Rain-kl/OpenFlare/tree/main/.agents/skills/clickhouse-batchwriterType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add Rain-kl/OpenFlare --skill clickhouse-batchwriter -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install Rain-kl/OpenFlare clickhouse-batchwriter --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Rain-kl/OpenFlare.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/clickhouse-batchwriter .agents/skills/clickhouse-batchwriter && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "clickhouse-batchwriter" agent skill from https://github.com/Rain-kl/OpenFlare/tree/main/.agents/skills/clickhouse-batchwriter into .agents/skills/clickhouse-batchwriter/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "clickhouse-batchwriter", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Rain-kl/OpenFlare --skill clickhouse-batchwriter -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install Rain-kl/OpenFlare clickhouse-batchwriter --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Rain-kl/OpenFlare.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/clickhouse-batchwriter .cursor/skills/clickhouse-batchwriter && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "clickhouse-batchwriter" agent skill from https://github.com/Rain-kl/OpenFlare/tree/main/.agents/skills/clickhouse-batchwriter into .cursor/skills/clickhouse-batchwriter/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "clickhouse-batchwriter", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/Rain-kl/OpenFlare.git --path .agents/skills/clickhouse-batchwriter--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add Rain-kl/OpenFlare --skill clickhouse-batchwriter -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install Rain-kl/OpenFlare clickhouse-batchwriter --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Rain-kl/OpenFlare.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/clickhouse-batchwriter .gemini/skills/clickhouse-batchwriter && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "clickhouse-batchwriter" agent skill from https://github.com/Rain-kl/OpenFlare/tree/main/.agents/skills/clickhouse-batchwriter into .gemini/skills/clickhouse-batchwriter/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "clickhouse-batchwriter", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install Rain-kl/OpenFlare clickhouse-batchwriterInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add Rain-kl/OpenFlare --skill clickhouse-batchwriter -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/Rain-kl/OpenFlare.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/clickhouse-batchwriter .github/skills/clickhouse-batchwriter && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "clickhouse-batchwriter" agent skill from https://github.com/Rain-kl/OpenFlare/tree/main/.agents/skills/clickhouse-batchwriter into .github/skills/clickhouse-batchwriter/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "clickhouse-batchwriter", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Rain-kl/OpenFlare --skill clickhouse-batchwriter -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install Rain-kl/OpenFlare clickhouse-batchwriter --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Rain-kl/OpenFlare.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/clickhouse-batchwriter .opencode/skills/clickhouse-batchwriter && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "clickhouse-batchwriter" agent skill from https://github.com/Rain-kl/OpenFlare/tree/main/.agents/skills/clickhouse-batchwriter into .opencode/skills/clickhouse-batchwriter/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "clickhouse-batchwriter", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
clickhouse-batchwriterWavelet 项目专用:当新增或修改 ClickHouse 批量写入、接入 internal/infra/persistence/batchwriter、将业务域异步 flush 到分析表、迁移 riskcontrol/节点访问日志/可观测时序写入、或评估 asyncinsert 与背压策略时必须使用。本技能指导分层职责、各域独立 Writer 实例、repository 批量 API…
Clickhouse Batchwriter is an agent skill from Rain-kl/OpenFlare. Wavelet 项目专用:当新增或修改 ClickHouse 批量写入、接入 internal/infra/persistence/batchwriter、将业务域异步 flush 到分析表、迁移 riskcontrol/节点访问日志/可观测时序写入、或评估 asyncinsert 与背压策略时必须使用。本技能指导分层职责、各域独立 Writer 实例、repository 批量 API 与禁止写法。
Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Databases, covering Data warehousing. It works with ClickHouse and Cloudflare. The repository describes itself as: OpenFlare is an open-source CDN orchestration and edge security platform. It supports reverse proxy, centralized configuration synchronization, in-network tunneling (Tunnels)… The licence is Apache-2.0.
6 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 7c2304d. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
gomakeFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Clickhouse Batchwriter loads about 1.4k tokens when it runs. Until then it costs about 57 tokens; SKILL.md has 343 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from Rain-kl/OpenFlare at commit 7c2304d, republished under its Apache-2.0 licence (© Rain-kl). 343 words, ~1,434 tokens.
.claude/skills/clickhouse-batchwriter/SKILL.md (or your agent's skills folder).开始前阅读根目录 AGENTS.md。ClickHouse 是辅助 OLAP 存储,厌恶高频单条写入(过多小 part);写入路径必须优先批量或异步聚合。
DDL 与表结构变更见 database-migration 技能。日志/分析用途表的判定、三库回落与切换见 logstore 技能。本技能只覆盖运行时写入架构。
| 层级 | 路径 | 职责 |
|---|---|---|
| 连接 | internal/infra/persistence/clickhouse.go | ChConn(原生批量写)、ChDB(GORM 查询);禁止在业务包直接 clickhouse.Open |
| 批量框架 | internal/infra/persistence/batchwriter/ | 泛型队列 + 按条数/时间 flush + 非阻塞入队 + 优雅停机;各业务域独立实例 |
| Model | internal/model/analytics/ | 列定义、TableName()、BatchInsertSQL()(及可选 InsertColumns()) |
| Repository | internal/repository/analytics/ | BatchInsert* / BatchInsertNodeAccessLogs 等;PrepareBatch + 多行 Append + 一次 Send |
| Apps | internal/apps/<domain>/ | 采集、入队、背压;FlushFunc 只调 logstore / repository,不写 SQL、不 PrepareBatch |
| 装配 | internal/platform/bootstrap/bootstrap.go | 进程启动时调用 Writer.Start;初始化时需调用 lifecycle.OnShutdown 挂载停机钩子 |
| 生命周期 | internal/platform/lifecycle/lifecycle.go | 统一协调全局并发优雅停机,业务包无需在 bootstrap.go 中硬编码 Stop 逻辑 |
禁止在 Handler / middleware 内直接 db.ChConn.PrepareBatch;禁止在 repository 内启动 goroutine 或维护全局 channel(队列生命周期由 apps + bootstrap 或专用 writer 包负责)。
writer, err := batchwriter.New[YourType](cfg, flushFunc, opts...)
writer.Start(ctx)
writer.TryEnqueue(item) // 非阻塞;满则 false
writer.IsFull() // 背压探测
writer.Stop(stopCtx) // close 队列 + drain + 最终 flushbatchwriter.DefaultConfig())QueueSize: 10_000MaxBatchSize: 1_000MinBatchSize: 50(未达阈值则跳过按时间 flush,除非设了 MaxFlushWait)FlushInterval: 1s各域可独立覆盖;可观测低频指标可用更小 MaxBatchSize(如 100)与更长 FlushInterval(如 2–5s),但不要退化为逐条 Send。
WithFlushErrorHandler[T]:flush 失败时记录日志;批次丢弃后 worker 继续WithDropHandler[T]:队列满或未 Start 时丢弃项func(ctx context.Context, items []T) errorlogstore.Active(ctx) 再调对应 BatchInsert*。禁止 apps 直连 analyticsrepo 或 db.ChConn。repository/analytics 的 BatchInsert*。Start 使用 context.WithoutCancel(parent),避免请求 ctx 取消中断后台 flush每个业务域拥有自己的 Writer、配置与 FlushFunc:
| 域 | 表 | 写入路径 |
|---|---|---|
| 管理端审计 | w_user_access_logs | risk_control → batchwriter → logstore.Active |
| 边缘访问日志 | of_node_access_logs | openflare/chwriter → logstore.Active |
| 可观测时序 | of_node_metric_snapshots 等 | openflare/chwriter 分表 writer + 进程内短 TTL 去重 → logstore.Active |
不要把 audit、access log、observability 并入同一 channel。
internal/model/analytics/ 定义 struct 与 BatchInsertSQL()(列顺序与 goose DDL 一致)。internal/infra/persistence/migrator/goose/clickhouse/ 新增迁移(见 database-migration)。BatchInsertX(ctx, []analyticsmodel.X) error:len(items)==0 直接返回db.ChConn == nil 返回明确错误PrepareBatch → 循环 Append → 一次 Sendinternal/apps/<domain>/):New + Start,并在初始化逻辑内通过 lifecycle.OnShutdown("your_writer_name", Stop) 注册停机回调FlushFunc 调 logstore.Active(见 logstore skill)TryEnqueue;HTTP 背压用 IsFull()ChConn 验证 BatchInsertSQL 与 append 列数go test ./internal/infra/persistence/batchwritermake code-check;有 API 变更时 make swagger。| 场景 | 推荐策略 |
|---|---|
| 管理端 API 审计 | 队列满 → IsFull() 触发 429(见 risk_control middleware) |
| Agent 心跳指标 | 队列满 → WithDropHandler 记 warn;不阻塞心跳响应 |
| 边缘 access log | 优先扩大队列与 batch;必要时丢弃最旧或采样 |
// ❌ 单条伪批量:每条都 PrepareBatch + Send
batch.Append(oneRow)
batch.Send()
// ❌ 写前 OLTP 式去重(高 RTT + 仍产生小 part)
SELECT count() FROM ... WHERE node_id = ? AND captured_at = ?
// ❌ Handler 内直接写 ClickHouse
db.ChConn.PrepareBatch(...)
// ❌ 全局单队列承载所有分析表
var globalChan chan any去重应使用:ReplacingMergeTree、查询侧 argMax、或进程内短 TTL 去重缓存——不要在每次 insert 前 SELECT count()。
可在 internal/infra/persistence/clickhouse.go 的 Settings 增加服务端异步写入作为第二层防护:
"async_insert": 1,
"wait_for_async_insert": 1,不能替代应用层批量;接入前需评估丢失可观测性与服务端负载。优先完成 batchwriter 接入后再考虑。
// internal/platform/bootstrap/bootstrap.go(示意)
func RegisterAPI(ctx context.Context) {
// 日志 writer 不依赖 clickhouse.enabled:flush 时由 logstore 选库
risk_control.InitLogWriter(ctx)
}RegisterAPI / RegisterAll:Startlifecycle.OnShutdown 注册,由 bootstrap.Stop() 代理 lifecycle.Stop() 并发停机。sync.Once 保证幂等go test ./internal/infra/persistence/batchwriter
go test ./internal/repository/analytics
make code-checkMaxBatchSize 与 FlushInterval 触发Stop 能 drain 队列内剩余项clickhouse.enabled: false 时 writer 仍 Start,flush 走主库 logstoreStart、不要入队internal/infra/persistence/batchwriter/{config,writer,errs}.gointernal/infra/persistence/clickhouse.gointernal/apps/risk_control/logics.gointernal/apps/openflare/chwriter/writer.gointernal/repository/logstoreinternal/repository/analytics/node_access_log_writer.gointernal/repository/analytics/node_observability_writer.gointernal/platform/lifecycle/lifecycle.gointernal/platform/bootstrap/bootstrap.go© Rain-kl, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .agents/skills/clickhouse-batchwriter of Rain-kl/OpenFlare.
Open the folder on GitHubat commit 7c2304d
Clickhouse Batchwriter next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Clickhouse Batchwriter this skillRain-kl/OpenFlare | 288 | — | ~1.4k | Automated safety check: Pass | Apache-2.0 | |
| Clickhouse Logs Queriessupabase/supabase | 111k | — | ~2.4k | Automated safety check: Pass | Apache-2.0 | |
| Keeper Stress AnalysisClickHouse/ClickHouse | 50k | — | ~4.7k | Automated safety check: Pass | Apache-2.0 | |
| Perf ComparisonClickHouse/ClickHouse | 50k | — | ~3.9k | Automated safety check: Notes | Apache-2.0 | |
| Patch Release CheckClickHouse/ClickHouse | 50k | — | ~4k | Automated safety check: Notes | Apache-2.0 | |
| Chdb SQLvemetric/vemetric | 395 | 1 repos | ~1.2k | Automated safety check: Pass | Apache-2.0 |
supabase/supabase
Write, review, and migrate Supabase logs queries against the ClickHouse-backed logs table (the logs.all.otel analytics endpoint).
ClickHouse/ClickHouse
Analyze ClickHouse Keeper stress-test results from play.clickhouse.com / keeperstresstests data warehouse.
ClickHouse/ClickHouse
Evaluate ClickHouse performance test results from existing CI/dashboard data or local perf.py runs.
ClickHouse/ClickHouse
Check whether ClickHouse's supported versions (last 3 majors + latest LTS) have recent stable patch releases, diagnose why the scheduled AutoReleases pipeline failed, and identify which releases…
vemetric/vemetric
A skill your agent uses when the user wants to run SQL — especially analytical SQL — on local files (parquet/csv/json), URLs, S3 paths, or remote databases (Postgres, MySQL, MongoDB, ClickHouse…
ClickHouse/ClickHouse
Bisect a ClickHouse regression using pre-built master binaries from CI.
Rain-kl/OpenFlare
Provides comprehensive code review guidance for React 19, Vue 3, Angular 17+, Svelte 5, Rust, TypeScript, Java, PHP, Python, Django, Go, C/.NET, Kotlin, Swift, NestJS, C/C++, and more.
Rain-kl/OpenFlare
在选择日志方案、配置 slog、编写结构化日志语句或决定日志级别时使用。也适用于设置生产日志、为日志添加请求作用域上下文或从 log 迁移到 slog 的场景,即使用户未明确提及日志。不涵盖错误处理策略(参见 go-error-handling)。
Rain-kl/OpenFlare
Wavelet 项目专用:当新增或修改自定义业务 API、新增业务路由、新增 service 层核心逻辑时必须使用。本技能指导包职责划分、推荐文件结构、路由解耦、Swagger 文档生成与质量门禁验证。
Rain-kl/OpenFlare
Wavelet 项目专用:当新增或修改业务缓存(RAM/Redis/DB 三层读路径)、缓存失效、多节点 pub/sub 同步、或评估高频读是否应接入缓存时必须使用。本技能说明系统标准缓存框架、参考实现、禁止写法与分布式一致性要求。
Rain-kl/OpenFlare
Wavelet 项目专用:当新增或修改数据库表结构、索引、初始化数据、系统配置 seed、模板 seed、默认管理员、goose SQL 迁移、internal/infra/persistence/migrator、ClickHouse 分析库 DDL 或数据库升级流程时必须使用。本技能指导在 internal/infra/persistence/migrator/goose 下编写…
Rain-kl/OpenFlare
Wavelet 项目专用:当业务需要上传文件、读取已上传文件、在 Worker/任务中程序化摄取字节流、选择存储引擎能力、或排查 wuploads / 文件统计异常时必须使用。本技能指导 storage 与 upload 分层、upload.Ingest 策略选型、前后端接入与禁止旁路写表。
Works with
Categories
Wavelet 项目专用:当新增或修改 ClickHouse 批量写入、接入 internal/infra/persistence/batchwriter、将业务域异步 flush 到分析表、迁移 riskcontrol/节点访问日志/可观测时序写入、或评估 asyncinsert 与背压策略时必须使用。本技能指导分层职责、各域独立 Writer 实例、repository 批量 API…. Clickhouse Batchwriter is an agent skill from Rain-kl/OpenFlare.
Clickhouse Batchwriter fits situations like: tasks that involve Data warehousing.
Run `npx skills add Rain-kl/OpenFlare --skill clickhouse-batchwriter -a claude-code`. Or copy the skill folder (.agents/skills/clickhouse-batchwriter in Rain-kl/OpenFlare) into .claude/skills/clickhouse-batchwriter in your project. Claude Code loads it when a task matches its description.
Run `npx skills add Rain-kl/OpenFlare --skill clickhouse-batchwriter -a codex`. Or copy the skill folder (.agents/skills/clickhouse-batchwriter in Rain-kl/OpenFlare) into .agents/skills/clickhouse-batchwriter in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Rain-kl/OpenFlare --skill clickhouse-batchwriter -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/clickhouse-batchwriter, .gemini/skills/clickhouse-batchwriter, .github/skills/clickhouse-batchwriter and .opencode/skills/clickhouse-batchwriter in your project.
Going by SKILL.md and its folder, Clickhouse Batchwriter needs the command-line tools its instructions call (go and make).
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Clickhouse Batchwriter is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.4k tokens (SKILL.md is roughly 5.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Clickhouse Batchwriter: Clickhouse Logs Queries (supabase/supabase, 111k stars), Keeper Stress Analysis (ClickHouse/ClickHouse, 50k stars), Perf Comparison (ClickHouse/ClickHouse, 50k stars) and Patch Release Check (ClickHouse/ClickHouse, 50k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Rain-kl (a GitHub user) maintains it in Rain-kl/OpenFlare, which has 288 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 8, 2026.
Source: Rain-kl/OpenFlare on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.