feat: persist boundary logs (#24812)

Add database persistence to `ReportBoundaryLogs`. On first log for a
session, the handler lazy-creates a `boundary_sessions` row, then
batch-inserts all `BoundaryLog` entries into `boundary_logs`. Structured
logging and usage tracking are preserved. Old boundary clients (no
`session_id`) fall back to log-only mode.

> [!NOTE]
> This PR was authored by Coder Agents.
This commit is contained in:
Sas Swart
2026-06-15 12:34:48 +02:00
committed by GitHub
parent e1c7e61eb9
commit f0ac52e83c
17 changed files with 868 additions and 130 deletions
-7
View File
@@ -1023,10 +1023,3 @@ type UpsertConnectionLogParams struct {
func (r GetLatestWorkspaceBuildWithStatusByWorkspaceIDRow) RBACObject() rbac.Object {
return r.WorkspaceTable.RBACObject()
}
func (s BoundarySession) RBACObject() rbac.Object {
if s.OwnerID.Valid {
return rbac.ResourceBoundaryLog.WithOwner(s.OwnerID.UUID.String())
}
return rbac.ResourceBoundaryLog
}