A collection of PostHog skills for enhancing AI-assisted workflows. Add this repo as a Claude Code plugin marketplace to get access to all PostHog skills: Then install individual plugins: Or browse available plugins: Copy any skill directory to .claude/skills/ in your project: Any directory under skills/ that contains a .claude-plugin/plugin.json is automatically discovered and added to the market
Add this skill
npx mdskills install PostHog/exploring-endpoint-execution-logs@PostHog? Sign in with GitHub to claim this listing.Highly focused log exploration skill with clear workflows, token reference, and strong diagnostic examples
1---2name: exploring-endpoint-execution-logs3description: >4 Explore and diagnose a PostHog endpoint's execution logs — error messages, failed runs, cache5 misses, slow runs, or unexpected row counts during endpoint invocations. Use when the user says6 "my endpoint is failing", "show me the logs for endpoint X", "what error did endpoint Y produce",7 "why did endpoint Z return no rows", "is this endpoint hitting cache", or "check the last N runs".8 Focused on a single named endpoint's runtime log entries, not project-wide auditing or query9 performance profiling.10---1112# Exploring endpoint execution logs1314Every endpoint run emits one execution log entry to PostHog's `log_entries` store. This skill15reads those entries for a specific endpoint to answer "what happened when it ran?". It is the16log-level counterpart to `diagnosing-endpoint-performance` (which reasons about cache/materialisation17strategy from config and `query_log`).1819## When to use this skill2021- "Why is my endpoint failing / erroring?"22- "Show me the logs / recent runs for endpoint X"23- "Did the last run hit cache? How many rows did it return?"24- "What happened the last time endpoint Y ran?"2526If the question is "this endpoint is slow, what should I change?", use27`diagnosing-endpoint-performance`. If it's project-wide ("what can I clean up?"), use28`auditing-endpoints`.2930## What an execution log entry looks like3132Each run produces exactly one entry. The level is `INFO` on success and `ERROR` on failure, and the33message carries the extra data as searchable `key=value` tokens:3435```text36Endpoint executed · path=materialized cache=hit duration_ms=142 rows=1024 version=337Endpoint execution failed · path=inline error=ResolutionError version=338```3940Token meanings:4142| Token | Values | Meaning |43| ------------- | ------------------------------------------------------------ | -------------------------------------------------------------- |44| `path` | `materialized` / `inline` / `ducklake` / `ducklake_fallback` | Which execution path ran |45| `cache` | `hit` / `miss` | Whether the query result cache was used (omitted for ducklake) |46| `duration_ms` | integer | Wall-clock execution time |47| `rows` | integer | Number of result rows returned |48| `version` | integer | Which endpoint version ran |49| `error` | e.g. `ResolutionError`, `HogVMException` | Error class / HogQL code name (failures only) |5051Each run gets a distinct `instance_id`, so logs group one-per-execution in the viewer.5253## Available tools5455| Tool | Purpose |56| --------------- | ----------------------------------------------------------------------------------------------------------------------------- |57| `endpoint-logs` | Primary. Execution log entries for one endpoint by name. Filter by level, search, time range, instance_id; `limit` up to 500. |58| `endpoint-get` | Endpoint config for context (current version, materialisation, query kind) |59| `execute-sql` | Fallback / aggregation directly against `log_entries` (`log_source='endpoints'`) |6061## Filtering6263`endpoint-logs` exposes the standard log filters:6465- **level** — comma-separated, e.g. `ERROR` to see only failed runs, or `INFO,ERROR` for all.66- **search** — case-insensitive substring over the message. Because the extra data is in67 `key=value` tokens, you can search `cache=miss`, `path=inline`, `error=ResolutionError`, or a68 specific `version=3`.69- **after / before** — ISO timestamps to bound the time range.70- **instance_id** — pin a single execution.71- **limit** — 1–500 (default 50).7273## Workflow74751. Identify the endpoint by name. If given a URL, parse it from76 `/api/projects/{team_id}/endpoints/{name}/run`.772. Start broad: `endpoint-logs` for the endpoint with a recent time range. Skim levels and tokens.783. Narrow to the symptom:79 - Failures → `level=ERROR`; read the `error=` token and `path=` to see where it broke.80 - Cache concerns → `search=cache=miss` to see how often runs miss cache.81 - Wrong results → compare `rows=` across runs, and `version=` to spot a regression after a82 version bump.834. For counts/trends across many runs (e.g. error rate over a week), drop to `execute-sql` against84 `log_entries`:8586 ```sql87 SELECT toDate(timestamp) AS day, upper(level) AS level, count() AS runs88 FROM log_entries89 WHERE log_source = 'endpoints' AND log_source_id = '<endpoint_uuid>'90 GROUP BY day, level ORDER BY day DESC91 ```9293 Get the endpoint UUID from `endpoint-get` (the `log_source_id` is the endpoint id, not its name).94955. Summarize: what's failing, since when, on which version/path, and whether it's a config issue96 (hand off to `diagnosing-endpoint-performance`) or a query bug.9798## Example interaction99100```text101User: "weekly_signups started erroring this morning"102103Agent steps:104- endpoint-logs weekly_signups, level=ERROR, after=<this morning>105 → several "Endpoint execution failed · path=inline error=ResolutionError version=5"106- endpoint-get weekly_signups → current version is v5 (bumped today)107- endpoint-logs weekly_signups, level=INFO, before=<this morning>108 → prior runs: "path=inline cache=hit ... version=4" succeeded109110- "v5 (created this morning) is failing with a ResolutionError on the inline path — it can't111 resolve a table or field reference. v4 ran fine. This looks like a bad query in the new112 version. Want me to pull the v5 query (endpoint-versions) so we can fix it, or roll back to v4?"113```114115## Important notes116117- **One entry per run.** Don't expect step-by-step traces — endpoints log a single completion line.118 The detail lives in the tokens, not in multiple lines.119- **`log_source_id` is the endpoint UUID**, not the name. For `execute-sql`, fetch it via120 `endpoint-get` first.121- **Logs are retained ~90 days** (the `log_entries` TTL). Older runs won't appear.122- **Execution logs ≠ query performance.** `endpoint-logs` tells you what happened and why a run123 failed; for "should I materialise / bump cache TTL?" use `diagnosing-endpoint-performance`, which124 reasons over config and `query_log` cost metrics.125- **Best-effort emission.** A log line is emitted after each run but never blocks it — if a run126 succeeded for the caller but no log shows, the emit was dropped, not the query.127
Full transparency — inspect the skill content before installing.