mirror of
https://github.com/coder/coder.git
synced 2026-06-03 04:58:23 +00:00
feat: add telemetry for task lifecycle events (#21922)
Relates to https://github.com/coder/internal/issues/1259 Adds new database queries and telemetry collection functions to gather task lifecycle events (pause/resume cycles, idle time) for analytics. Task events track pause/resume activity, idle duration before pausing, paused duration, and time from resume to first app status, filtered to recent activity based on the telemetry snapshot interval. 🤖 Created with Mux (Opus 4.6).
This commit is contained in:
@@ -124,6 +124,24 @@ sql:
|
||||
- column: "tasks_with_status.workspace_app_health"
|
||||
go_type:
|
||||
type: "NullWorkspaceAppHealth"
|
||||
# Workaround for sqlc not interpreting the left join correctly
|
||||
# in the combined telemetry query.
|
||||
- column: "task_event_data.start_build_number"
|
||||
go_type: "database/sql.NullInt32"
|
||||
- column: "task_event_data.stop_build_created_at"
|
||||
go_type: "database/sql.NullTime"
|
||||
- column: "task_event_data.stop_build_reason"
|
||||
go_type:
|
||||
type: "NullBuildReason"
|
||||
- column: "task_event_data.start_build_created_at"
|
||||
go_type: "database/sql.NullTime"
|
||||
- column: "task_event_data.start_build_reason"
|
||||
go_type:
|
||||
type: "NullBuildReason"
|
||||
- column: "task_event_data.last_working_status_at"
|
||||
go_type: "database/sql.NullTime"
|
||||
- column: "task_event_data.first_status_after_resume_at"
|
||||
go_type: "database/sql.NullTime"
|
||||
rename:
|
||||
group_member: GroupMemberTable
|
||||
group_members_expanded: GroupMember
|
||||
|
||||
Reference in New Issue
Block a user