Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/clickhouse-webhooks-events

@0d57af8
Run it yourself

Ingest data into ClickHouse from webhooks, Kafka, and streaming sources with batching, dedup, and exactly-once patterns. Use when building data ingestion pipelines, consuming webhook payloads, or integrating Kafka topics into ClickHouse. Trigger with "clickhouse ingestion", "clickhouse webhook", "clickhouse Kafka", "stream data to clickhouse", "clickhouse data pipeline".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/clickhouse-webhooks-events

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesdedup-and-monitoring.md

≈595 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Deduplication, Monitoring & Insert Best Practices

Deep reference for making ingestion idempotent, observing insert throughput and errors, and tuning batch behavior. The main SKILL.md summarizes these; the full DDL, monitoring queries, and the best-practices matrix live here.

Deduplication with ReplacingMergeTree

Webhook retries and Kafka reprocessing deliver the same event more than once. ReplacingMergeTree collapses rows sharing the same ORDER BY key, keeping the row with the highest version — so a re-delivered event_id never double-counts.

-- For idempotent ingestion (webhook retries, Kafka reprocessing)
CREATE TABLE analytics.events_dedup (
    event_id    String,           -- Unique event identifier
    event_type  LowCardinality(String),
    user_id     UInt64,
    properties  String,
    created_at  DateTime,
    _version    UInt64 DEFAULT toUnixTimestamp(now())
)
ENGINE = ReplacingMergeTree(_version)
ORDER BY event_id;               -- Dedup key

-- Insert duplicate-safe: same event_id keeps latest _version
-- Query with FINAL for deduplicated results
SELECT * FROM analytics.events_dedup FINAL
WHERE created_at >= today() - 7;

Insert Monitoring

system.query_log records every insert, so throughput and errors are queryable without extra instrumentation.

-- Track insert throughput
SELECT
    toStartOfMinute(event_time) AS minute,
    count() AS inserts,
    sum(written_rows) AS rows_inserted,
    formatReadableSize(sum(written_bytes)) AS bytes_inserted
FROM system.query_log
WHERE type = 'QueryFinish'
  AND query_kind = 'Insert'
  AND event_time >= now() - INTERVAL 1 HOUR
GROUP BY minute
ORDER BY minute;

-- Check for insert errors
SELECT event_time, exception, substring(query, 1, 200)
FROM system.query_log
WHERE type = 'ExceptionWhileProcessing'
  AND query_kind = 'Insert'
  AND event_time >= now() - INTERVAL 1 HOUR
ORDER BY event_time DESC;

Insert Best Practices

Practice Why
Batch 10K-100K rows per INSERT Fewer parts, faster merges
Buffer 1-5 seconds for real-time Balances latency vs throughput
Use JSONEachRow format Client handles serialization
Compress with ZSTD on wire Reduces network transfer
Use ReplacingMergeTree for retries Handles duplicate delivery
Use async_insert=1 for small batches Server-side batching

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill is designed for ClickHouse data ingestion and is generally safe. It identifies a low-risk surface for indirect prompt injection because it ingests untrusted data from webhooks, and notes standard network operations for data transfer.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: MEDIUM · 1 issue

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 months ago
What it can do
Reads files Edits files Runs commands
version
1.7.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "saas",
  "database",
  "analytics",
  "clickhouse",
  "olap"
]
All 4 allowed tools
ReadWriteEditBash(curl:*)
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/clickhouse-webhooks-events