feat: add initial API for boundary log forwarding to coderd (#21293)

Add the AgentAPI changes to support the feature that transmits boundary
logs from workspaces to coderd via the agent API for eventual re-emission to
stderr. The API handlers are stubs for now because I'm trying to land
this feature from multiple smaller PRs.

High level architecture:
- Boundary records resource access in batches and sends proto message to
agent
- Agent proxies messages to coderd **(captured by the API changes in
this PR)**
- coderd re-emits logs to stderr

RFC:
https://www.notion.so/coderhq/Agent-Boundary-Logs-2afd579be59280f29629fc9823ac41ba
This commit is contained in:
Zach
2025-12-19 10:41:39 -07:00
committed by GitHub
parent ea00e72063
commit 9d1493a13a
15 changed files with 761 additions and 301 deletions
+3
View File
@@ -54,6 +54,7 @@ type API struct {
*ScriptsAPI
*ConnLogAPI
*SubAgentAPI
*BoundaryLogsAPI
*tailnet.DRPCService
cachedWorkspaceFields *CachedWorkspaceFields
@@ -219,6 +220,8 @@ func New(opts Options, workspace database.Workspace) *API {
Database: opts.Database,
}
api.BoundaryLogsAPI = &BoundaryLogsAPI{}
// Start background cache refresh loop to handle workspace changes
// like prebuild claims where owner_id and other fields may be modified in the DB.
go api.startCacheRefreshLoop(opts.AuthenticatedCtx)