Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)41k · #6862

exploring-endpoint-execution-logs

Skill này làm gì

Skill này đọc mục nhật ký được ghi cho mỗi lần chạy endpoint và giải thích điều đã xảy ra, như một lỗi hoặc một kết quả trống. Nó dành cho người cần biết vì sao một endpoint hành xử theo một cách nhất định.

Khi nào nên dùng

  • ✓Khi một endpoint thất bại và bạn muốn xem thông báo lỗi từ các lần chạy của nó.
  • ✓Khi một endpoint trả về không có dòng nào và bạn muốn biết lý do.
  • ✓Khi bạn muốn kiểm tra các lần chạy gần đây của một endpoint, gồm việc chúng có dùng bộ nhớ đệm hay không.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/PostHog/posthog/blob/master/products/endpoints/skills/exploring-endpoint-execution-logs/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Cho tôi xem nhật ký của endpoint khách hàng của tôi và cho biết vì sao ba lần chạy gần nhất thất bại.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Mỗi lần chạy ghi một mục nhật ký gồm kết quả, thời lượng và số dòng. Skill tìm trong các mục đó cho endpoint cụ thể và tóm tắt chúng.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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
    
Câu hỏi thường gặp

Mỗi lần chạy có tạo nhật ký không?

Có. Mỗi lần chạy endpoint thêm một mục nhật ký, được đánh dấu là info khi thành công và error khi thất bại.

Tôi có thể xem các lần chạy chậm không?

Có. Thời lượng được ghi trong mỗi mục nhật ký, nên có thể tìm và so sánh các lần chạy chậm.

Skill này khác gì với skill hiệu năng?

Skill này đọc những gì đã xảy ra trong mỗi lần chạy, còn skill hiệu năng suy luận về bộ nhớ đệm và cấu hình.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
41k
Vị trí xếp hạng
#6862
Giấy phép
—
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự