Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

querying-tophog

Skill by PostHog

Queries PostHog's tophog heavy-hitter table in ClickHouse through internal Metabase to find hot or expensive actors during ingestion incidents. Built for PostHog engineers doing incident triage.

  • Score 83
  • 41k stars
  • NOASSERTION
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install querying-tophog

Built from the published package, never by AI.

git clone --depth 1 https://github.com/PostHog/posthog /tmp/posthog && mkdir -p ~/.claude/skills && cp -r /tmp/posthog/.agents/skills/querying-tophog ~/.claude/skills/querying-tophog

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install querying-tophog in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill explains how to query tophog, the ingestion pipeline's heavy-hitter store in ClickHouse. Workers accumulate per-key counts and timers in memory and flush them through Kafka. The data identifies which team, distinct_id, session_id or partition is responsible for lag or cost, since fleet-level Prometheus metrics cannot hold those labels.

The agent runs queries through the internal Metabase using the engineer's own SSO session, which the user starts with hogli. It covers the tophog schema, metric discovery, and a cost-versus-volume lens for separating hot keys from expensive actors. Use it for incident triage on ingestion lag, hot partitions, or merge storms. Results contain cross-customer identifiers, so it is for internal staff only.

Written from the project's SKILL.md and checked against it.

What it can do

  • Metric discoveryLists the tophog metrics seen in the last hour, with their types and observation counts.
  • Top actors by person-processing costRanks team_id and distinct_id pairs by summed process_persons_time to find slow actors.
  • Partition-scoped queriesFilters person-processing cost to one lagging Kafka partition.
  • Merge storm analysisRanks distinct_ids by merge_events_per_distinct_id to find merge-heavy actors.
  • Generic top-10 per metricReturns the top keys for each metric using the correct sum, max or avg semantics.
  • Cost vs volume classificationUses the ms-per-event ratio to tell hot keys from expensive actors.

What you need

  • PostHog internal access to the internal Metabase
  • hogli CLI with the metabase:login command
  • An SSO session in the browser for Metabase login
  • macOS, as the Keychain login prompt is described

Try asking

  • Find the top 10 actors by person-processing cost in the last hour
  • Show merge storms by distinct_id for the last hour
  • Check whether process_persons_time has partition data yet

Good to know

  • Internal PostHog use only, because results contain cross-customer identifiers.
  • Tophog data is kept for 30 days.
  • The user must run the Metabase login step themselves.
  • Partition and merge dimensions only exist in data written after their deploy.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .agents/skills/querying-tophog/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md9 KB

Alternatives to querying-tophog

All alternatives →
kaggle-cliKaggle
94

Guides an assistant through the Kaggle CLI, covering competitions, datasets, notebooks, models, benchmarks, authentication and quota. It is for people who use the kaggle command-line tool.

AAA Skill 7.7k
bigquery-bigframesgoogle
94

Generates Python code that uses BigQuery DataFrames (BigFrames) for data processing, analysis and machine learning on BigQuery. It is meant for Python data tasks, and the source says to use bigquery-basics for SQL-first workflows.

AAA Skill 25k
data-loadingmicrosoft
94

Discovers connected data sources and proposes loading options when a workspace lacks the data a question needs. Suited to users who want to connect database, warehouse or cloud sources from the chat.

AAA Skill 18k
data-manager-api-setupgoogle
94

Guides developers through enabling the Data Manager API, setting up Application Default Credentials, and installing its client libraries. Built for developers who are getting started with the API and need local environment and access setup.

AAA Skill 25k
managed-airflow-dag-authoringgoogle
94

Guides authoring and validating Apache Airflow DAGs for Managed Service for Apache Airflow (MSAA), formerly Cloud Composer. Built for developers who create or extend Airflow DAGs in these environments.

AAA Skill 25k
data-feedsdavila7
94

Extracts structured JSON data from over 40 websites, including Amazon, LinkedIn, Instagram, TikTok, Facebook and YouTube. Built on Bright Data's Web Data APIs, it returns product details, profiles, reviews, posts and comments from a URL.

AAA Skill 34k

Compare with kaggle-cli, bigquery-bigframes or data-loading

querying-tophog: common questions

What is tophog?

tophog is the ingestion pipeline's heavy-hitter store in ClickHouse. Workers flush per-key aggregates to it through the clickhouse_tophog Kafka topic.

Why not query ClickHouse directly from Grafana?

The source says there is deliberately no ClickHouse datasource for agents in Grafana because production clusters hold customer data. The sanctioned path is internal Metabase with the engineer's own SSO session.

Are distinct_id values sensitive?

Yes. The source says distinct_id and session_id values are customer PII, often emails, so they must not be pasted into public PRs, issues, or commits.

How do I install querying-tophog?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is querying-tophog free?

The code is published under the NOASSERTION licence. The service it connects to may have its own pricing.

Is querying-tophog safe to use?

It scores 83 of 100. Grades: maintenance A, licence F, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to querying-tophog?

Similar skills: kaggle-cli, bigquery-bigframes, data-loading, data-manager-api-setup.

querying-tophog Install

Add to stack

Loading.