2.5 KiB
2.5 KiB
id, title, status, assignee, created_date, updated_date, labels, dependencies, references, priority, ordinal
| id | title | status | assignee | created_date | updated_date | labels | dependencies | references | priority | ordinal | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ML-161 | pi access to production errors | To Do | 2026-05-04 08:06 | 2026-05-04 08:10 |
|
|
|
medium | 4000 |
Description
Errors in production are captured via the error_tracker Elixir dependency and accessed via a dedicated dashboard at /dev/errors. There is no built-in tooling or endpoint to pull production errors programmatically in a pi session. This task covers the investigation and implementation of the best approach to expose production error data to pi, broken into three subtasks:
- Expose production errors via a programmatic API (behind auth) — Add a JSON API endpoint under
/api/v1/errorsthat lists errors and shows individual error details from the error_tracker tables. - Create pi tools to pull errors — Implement
fetch_production_errors(list with filtering/pagination) andfetch_production_error(single error detail) as pi tools. - Create a pi extension to browse errors — Build an interactive TUI browsing experience via a pi extension that uses the tools from subtask 2.
Error data attributes
These are the attributes that subtask implementations must treat as the canonical data model:
Error (from error_tracker_errors table):
id— UUID, unique error identifierkind— string, e.g. "error", "throw", "exit"reason— string, the error message/reasonsource_line— string, e.g. "lib/foo.ex:42"source_function— string, e.g. "MusicLibrary.Foo.bar/2"status— atom::resolved|:unresolvedfingerprint— hex string, deterministic hash of (kind, source_line, source_function)last_occurrence_at— UTC datetime (microsecond precision)muted— booleaninserted_at/updated_at— UTC datetime
Occurrence (from error_tracker_occurrences table):
id— UUIDreason— string, error reason at time of occurrencecontext— map, includeslive_view.view,request.path, etc.breadcrumbs— array of stringsstacktrace— embedded struct withlinesarray (each having:application,module,function,arity,file,line)error_id— FK to errorinserted_at— UTC datetime
Aggregated/per-error metadata (computed, not stored):
occurrence_count— total occurrences for this errorfirst_occurrence_at— earliest occurrence timestamp