exploring-endpoint-execution-logs

작성자: posthog

PostHog 엔드포인트의 실행 로그(오류 메시지, 실패한 실행, 캐시 미스, 느린 실행, 엔드포인트 중 예상치 못한 행 수 등)를 탐색하고 진단합니다.

npx skills add https://github.com/posthog/skills --skill exploring-endpoint-execution-logs

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:

Endpoint executed · path=materialized cache=hit duration_ms=142 rows=1024 version=3
Endpoint execution failed · path=inline error=ResolutionError version=3

Token meanings:

TokenValuesMeaning
pathmaterialized / inline / ducklake / ducklake_fallbackWhich execution path ran
cachehit / missWhether the query result cache was used (omitted for ducklake)
duration_msintegerWall-clock execution time
rowsintegerNumber of result rows returned
versionintegerWhich endpoint version ran
errore.g. ResolutionError, HogVMExceptionError class / HogQL code name (failures only)

Each run gets a distinct instance_id, so logs group one-per-execution in the viewer.

Available tools

ToolPurpose
endpoint-logsPrimary. Execution log entries for one endpoint by name. Filter by level, search, time range, instance_id; limit up to 500.
endpoint-getEndpoint config for context (current version, materialisation, query kind)
execute-sqlFallback / aggregation directly against log_entries (log_source='endpoints')

Filtering

endpoint-logs exposes the standard log filters:

  • level — comma-separated, e.g. ERROR to see only failed runs, or INFO,ERROR for all.
  • search — case-insensitive substring over the message. Because the extra data is in key=value tokens, you can search cache=miss, path=inline, error=ResolutionError, or a specific version=3.
  • after / before — ISO timestamps to bound the time range.
  • instance_id — pin a single execution.
  • limit — 1–500 (default 50).

Workflow

  1. Identify the endpoint by name. If given a URL, parse it from /api/projects/{team_id}/endpoints/{name}/run.

  2. Start broad: endpoint-logs for the endpoint with a recent time range. Skim levels and tokens.

  3. Narrow to the symptom:

    • Failures → level=ERROR; read the error= token and path= to see where it broke.
    • Cache concerns → search=cache=miss to see how often runs miss cache.
    • Wrong results → compare rows= across runs, and version= to spot a regression after a version bump.
  4. 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).

  5. 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

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?"

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_id is the endpoint UUID, not the name. For execute-sql, fetch it via endpoint-get first.
  • Logs are retained ~90 days (the log_entries TTL). Older runs won't appear.
  • Execution logs ≠ query performance. 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.
  • 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.

posthog의 다른 스킬

error-tracking-hono
posthog
PostHog 오류 추적 for Hono
tuning-incremental-sync-config
posthog
동기화의 구성은 ExternalDataSchema에 저장되며, external-data-schemas-partial-update를 통해 언제든지 변경할 수 있습니다. 대부분의 변경은 비파괴적이며(다음 동기화에 적용됨), 일부 변경(sync_type 전환, 기본 키 변경)은 동기화된 데이터 손상을 방지하기 위해 신중한 처리가 필요합니다.
playwright-test
posthog
플레이라이트 테스트를 작성하고, 실행이 잘 되며, 불안정하지 않도록 하세요.
error-tracking-ruby
posthog
PostHog Ruby 오류 추적
authoring-log-alerts
posthog
PostHog 프로젝트의 서비스에 유용하고 노이즈가 적은 로그 알림을 작성합니다. 사용자가 로그에 대한 알림 설정을 요청하거나 추가해야 할 알림을 제안할 때 사용하세요.
making-scenes-tab-aware
posthog
Guides converting PostHog frontend scenes to be tab aware for internal scene tabs. Use when adding or refactoring a `SceneExport` scene, fixing state leaking…
posthog-survey-creator
posthog
PostHog에서 안내 대화를 통해 설문조사를 생성하고 구성합니다. 사용자가 설문조사를 만들거나, 사용자 피드백을 수집하거나, 실행하려 할 때 이 스킬을 사용하세요.
authoring-scouts
posthog
PostHog Signals 스카우트를 작성, 편집 및 조정하는 방법 — 프로젝트를 스캔하고 Signals 인박스에 보고서를 작성하는 예약된 에이전트입니다. 사용자가…