Exploring endpoint execution logs
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).
When to use this skill
- "Why is my endpoint failing / erroring?"
- "Show me the logs / recent runs for endpoint X"
- "Did the last run hit cache? How many rows did it return?"
- "What happened the last time endpoint Y ran?"
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.
What an execution log entry looks like
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:
Token meanings:
Each run gets a distinct instance_id, so logs group one-per-execution in the viewer.
Available tools
Filtering
endpoint-logs exposes the standard log filters:
- level — comma-separated, e.g.
ERRORto see only failed runs, orINFO,ERRORfor all. - search — case-insensitive substring over the message. Because the extra data is in
key=valuetokens, you can searchcache=miss,path=inline,error=ResolutionError, or a specificversion=3. - after / before — ISO timestamps to bound the time range.
- instance_id — pin a single execution.
- limit — 1–500 (default 50).
Workflow
-
Identify the endpoint by name. If given a URL, parse it from
/api/projects/{team_id}/endpoints/{name}/run. -
Start broad:
endpoint-logsfor the endpoint with a recent time range. Skim levels and tokens. -
Narrow to the symptom:
- Failures →
level=ERROR; read theerror=token andpath=to see where it broke. - Cache concerns →
search=cache=missto see how often runs miss cache. - Wrong results → compare
rows=across runs, andversion=to spot a regression after a version bump.
- Failures →
-
For counts/trends across many runs (e.g. error rate over a week), drop to
execute-sqlagainstlog_entries:Get the endpoint UUID from
endpoint-get(thelog_source_idis 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.
Example interaction
Important notes
- One entry per run. Don't expect step-by-step traces — endpoints log a single completion line. The detail lives in the tokens, not in multiple lines.
log_source_idis the endpoint UUID, not the name. Forexecute-sql, fetch it viaendpoint-getfirst.- Logs are retained ~90 days (the
log_entriesTTL). Older runs won't appear. - Execution logs ≠ query performance.
endpoint-logstells you what happened and why a run failed; for "should I materialise / bump cache TTL?" usediagnosing-endpoint-performance, which reasons over config andquery_logcost metrics. - Best-effort emission. A log line is emitted after each run but never blocks it — if a run succeeded for the caller but no log shows, the emit was dropped, not the query.


