skills/exploring-endpoint-execution-logs/SKILL.md
Explore and diagnose a PostHog endpoint's execution logs — error messages, failed runs, cache misses, slow runs, or unexpected row counts during endpoint invocations. Use when the user says "my endpoint is failing", "show me the logs for endpoint X", "what error did endpoint Y produce", "why did endpoint Z return no rows", "is this endpoint hitting cache", or "check the last N runs". Focused on a single named endpoint's runtime log entries, not project-wide auditing or query performance profiling.
npx skillsauth add posthog/ai-plugin exploring-endpoint-execution-logsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Every endpoint run emits one execution log entry to PostHog's log_entries store. This skill
reads those entries for a specific endpoint to answer "what happened when it ran?". It is the
log-level counterpart to diagnosing-endpoint-performance (which reasons about cache/materialisation
strategy from config and query_log).
If the question is "this endpoint is slow, what should I change?", use
diagnosing-endpoint-performance. If it's project-wide ("what can I clean up?"), use
auditing-endpoints.
Each run produces exactly one entry. The level is INFO on success and ERROR on failure, and the
message carries the extra data as searchable key=value tokens:
Endpoint executed · path=materialized cache=hit duration_ms=142 rows=1024 version=3
Endpoint execution failed · path=inline error=ResolutionError version=3
Token meanings:
| Token | Values | Meaning |
| ------------- | ------------------------------------------------------------ | -------------------------------------------------------------- |
| path | materialized / inline / ducklake / ducklake_fallback | Which execution path ran |
| cache | hit / miss | Whether the query result cache was used (omitted for ducklake) |
| duration_ms | integer | Wall-clock execution time |
| rows | integer | Number of result rows returned |
| version | integer | Which endpoint version ran |
| error | e.g. ResolutionError, HogVMException | Error class / HogQL code name (failures only) |
Each run gets a distinct instance_id, so logs group one-per-execution in the viewer.
| Tool | Purpose |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| endpoint-logs | Primary. Execution log entries for one endpoint by name. Filter by level, search, time range, instance_id; limit up to 500. |
| endpoint-get | Endpoint config for context (current version, materialisation, query kind) |
| execute-sql | Fallback / aggregation directly against log_entries (log_source='endpoints') |
endpoint-logs exposes the standard log filters:
ERROR to see only failed runs, or INFO,ERROR for all.key=value tokens, you can search cache=miss, path=inline, error=ResolutionError, or a
specific version=3.Identify the endpoint by name. If given a URL, parse it from
/api/projects/{team_id}/endpoints/{name}/run.
Start broad: endpoint-logs for the endpoint with a recent time range. Skim levels and tokens.
Narrow to the symptom:
level=ERROR; read the error= token and path= to see where it broke.search=cache=miss to see how often runs miss cache.rows= across runs, and version= to spot a regression after a
version bump.For counts/trends across many runs (e.g. error rate over a week), drop to execute-sql against
log_entries:
SELECT toDate(timestamp) AS day, upper(level) AS level, count() AS runs
FROM log_entries
WHERE log_source = 'endpoints' AND log_source_id = '<endpoint_uuid>'
GROUP BY day, level ORDER BY day DESC
Get the endpoint UUID from endpoint-get (the log_source_id is the endpoint id, not its name).
Summarize: what's failing, since when, on which version/path, and whether it's a config issue
(hand off to diagnosing-endpoint-performance) or a query bug.
User: "weekly_signups started erroring this morning"
Agent steps:
- endpoint-logs weekly_signups, level=ERROR, after=<this morning>
→ several "Endpoint execution failed · path=inline error=ResolutionError version=5"
- endpoint-get weekly_signups → current version is v5 (bumped today)
- endpoint-logs weekly_signups, level=INFO, before=<this morning>
→ prior runs: "path=inline cache=hit ... version=4" succeeded
- "v5 (created this morning) is failing with a ResolutionError on the inline path — it can't
resolve a table or field reference. v4 ran fine. This looks like a bad query in the new
version. Want me to pull the v5 query (endpoint-versions) so we can fix it, or roll back to v4?"
log_source_id is the endpoint UUID, not the name. For execute-sql, fetch it via
endpoint-get first.log_entries TTL). Older runs won't appear.endpoint-logs tells you what happened and why a run
failed; for "should I materialise / bump cache TTL?" use diagnosing-endpoint-performance, which
reasons over config and query_log cost metrics.data-ai
Signals scout for PostHog Tasks, the agent work items a project runs. Two lenses: delivery health (runs failing, clustered by repository and error class, and retry storms) every run, and on a slower rotation demand (recurring asks across human-authored tasks that point at a product gap). Skips the scout fleet's own run rows.
devops
Signals scout for the PostHog Conversations (support inbox) product. Watches the `$conversation_*` ticket-lifecycle events for support-delivery regressions — SLA breach-rate steps, first-response latency blowouts, backlog inflow-vs-resolution imbalance, and channel / assignment concentration — and files each dated regression as a report. Complements the per-ticket product-feedback signals the emission pipeline already fires; does not re-surface individual ticket content.
development
Populates and maintains a project's data catalog (semantic layer): canonical metrics, trust marks (certifications) on warehouse tables/views, and reviewed table relationships. Use when asked to set up / seed / bootstrap the data catalog or semantic layer, to catalog a project's metrics, to certify or deprecate data sources, to propose or review table joins, or to work through the proposal review queue. To *use* an existing catalog to answer a business-number question, see querying-posthog-data instead. Trigger terms: data catalog, semantic layer, canonical metric, certify table, deprecate source, relationship proposal, metric drift, review queue.
tools
Investigate logs in a PostHog project: verify a service or deployment is healthy, explain an error spike, triage an incident, or understand what a log stream is saying. Use when the user asks to "check the logs", asks whether a service, deploy, release, or change is working or broke anything, asks why errors are up or what changed, or wants the root cause of failures visible in logs. Routes the logs MCP tools (services overview, pattern mining, before/after pattern diffing, bucketed counts, facets, raw rows) so investigations start from summaries instead of raw rows or hand-written SQL over the logs table.