跳到正文
Skillpedia
部署与云(DevOps)41k · #6862

exploring-endpoint-execution-logs

它能做什么

本技能读取每次端点运行时写入的日志记录,并说明发生了什么,例如出现错误或结果为空。适合需要了解端点为何表现如此的人。

适用场景

  • ✓当某个端点运行失败,你想查看其运行时的错误信息时。
  • ✓当某个端点返回了空结果,你想知道原因的时候。
  • ✓当你想查看端点最近几次运行的情况,包括是否使用了缓存时。

技能链接

https://github.com/PostHog/posthog/blob/master/products/endpoints/skills/exploring-endpoint-execution-logs/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/PostHog/posthog/blob/master/products/endpoints/skills/exploring-endpoint-execution-logs/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请显示我的客户端点的日志,并告诉我最近三次运行为何失败。”

每周 5 个新技能,1 分钟读完。

工作原理

每次运行都会写入一条日志,记录其结果、耗时和行数。本技能会在这些记录中搜索特定端点,并进行汇总。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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:

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.

Available tools

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')

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_sou
    
常见问题

每次运行都会生成日志吗?

是的。每次端点运行都会添加一条日志记录,成功时标记为 info,失败时标记为 error。

我能查看运行缓慢的情况吗?

可以。每条日志记录都包含耗时,因此可以找出并比较较慢的运行。

它与性能技能有什么不同?

本技能读取每次运行中发生的事情,而性能技能则分析缓存和配置。

详情

作者的原始描述

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.

repo: PostHog/posthog

热度

GitHub 星标
41k
排名
#6862
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能