task_history


Description

{“what”:“History of task executions with timing, status, and logs.”,“why”:“Provides an audit trail to debug and monitor scheduled or manual tasks.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:03.755785447+00:00”}

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id int4 10 √ null

{“what”:“Surrogate key for a single task run.”,“why”:“Enables referencing a specific run in logs and foreign keys.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:03.769671066+00:00”}

task varchar 254 null

{“what”:“Name or identifier of the task that was executed, e.g., ‘nightly_backup’.”,“why”:“Distinguishes which task this history entry belongs to.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:03.813168040+00:00”}

db_id int4 10 √ null

{“what”:“Identifier of the database or connection used for the task.”,“why”:“Links the run to a specific database context for filtering.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:03.832447560+00:00”}

started_at timestamptz 35,6 CURRENT_TIMESTAMP

{“what”:“Timestamp when the task started, in UTC with timezone.”,“why”:“Allows ordering runs and computing duration with ended_at.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:03.878033399+00:00”}

ended_at timestamptz 35,6 √ null

{“what”:“Timestamp when the task finished, null if still running.”,“why”:“Needed to compute duration and detect incomplete runs.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:03.934488498+00:00”}

duration int4 10 √ null

{“what”:“Elapsed time of the task run in seconds.”,“why”:“Allows quick comparison of run times without timestamp arithmetic.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:03.975469186+00:00”}

task_details text 2147483647 √ null

{“what”:“Free-form text with task parameters or output details.”,“why”:“Provides context for debugging when status is not success.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:04.022774989+00:00”}

status varchar 21 'started'::character varying

{“what”:“Current state of the task, e.g., ‘started’, ‘completed’, ‘failed’.”,“why”:“Filters runs by outcome and identifies unfinished tasks.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:04.047794075+00:00”}

run_id int4 10 √ null
task_run.id fk_task_history_run_id N

{“what”:“Identifier of the parent run or batch that triggered this task.”,“why”:“Groups multiple task executions under a single run for analysis.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:04.076425145+00:00”}

logs text 2147483647 √ null

{“what”:“Captured log output from the task execution.”,“why”:“Diagnoses failures without re-running the task.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:07:04.131053691+00:00”}

Indexes

Constraint Name Type Sort Column(s)
task_history_pkey Primary key Asc id
idx_task_history_db_id Performance Asc db_id
idx_task_history_end_time Performance Asc ended_at
idx_task_history_run_id Performance Asc run_id
idx_task_history_started_at Performance Asc started_at

Relationships