Skip to content

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

Merged
zedkipp merged 1 commit into
mainfrom
zedkipp/boundary-logs-api
Dec 19, 2025
Merged

feat: add initial API for boundary log forwarding to coderd#21293
zedkipp merged 1 commit into
mainfrom
zedkipp/boundary-logs-api

Conversation

@zedkipp

@zedkipp zedkipp commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

Add the API 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

#21280

Comment thread agent/proto/agent.proto Outdated
@zedkipp zedkipp changed the title feat: add inital API for boundary log forwarding to coderd feat: add initial API for boundary log forwarding to coderd Dec 16, 2025
@zedkipp zedkipp marked this pull request as ready for review December 16, 2025 21:12
Comment thread agent/proto/agent.proto
rpc CreateSubAgent(CreateSubAgentRequest) returns (CreateSubAgentResponse);
rpc DeleteSubAgent(DeleteSubAgentRequest) returns (DeleteSubAgentResponse);
rpc ListSubAgents(ListSubAgentsRequest) returns (ListSubAgentsResponse);
rpc ReportBoundaryLogs(ReportBoundaryLogsRequest) returns (ReportBoundaryLogsResponse);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any opinions on this RPC name?

Comment thread go.mod Outdated
// by boundary, which lives in a separate repository.
require github.com/coder/coder/v2/agent/proto/boundary_logs v0.0.0-incompatible

replace github.com/coder/coder/v2/agent/proto/boundary_logs => ./agent/proto/boundary_logs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why this is needed and the comment is not really helping.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a essentially the way to use a nested Go module in a way that doesn't need to refer to a specific version of said module. I was planning to import the nested module in boundary.

I nuked this approach in favor of keeping AgentAPI independent, and separately defining the boundary <-> agent API (future PRs). I realized there’s little benefit from tightly coupling everything now other than re-using generated types. cc @johnstcn

@johnstcn johnstcn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proto changes look OK to me but I'm less certain about having them in the coder/coder repo. What would you think about inverting the direction of the import?

Comment thread agent/proto/agent.proto
@zedkipp zedkipp force-pushed the zedkipp/boundary-logs-api branch from effad7c to 92de60c Compare December 17, 2025 22:23
Add the API changes to support the feature that transmits boundary logs
from workspaces to coderd via the agent API, then re-emits them to stderr.

Architecture:
- Boundary process connects to Unix socket
- Boundary batches logs and sends TLV prefixed protobuf messages to Agent
- Agent proxies messages to coderd via DRPC
- coderd re-emits to stderr
@zedkipp zedkipp merged commit 9d1493a into main Dec 19, 2025
65 of 69 checks passed
@zedkipp zedkipp deleted the zedkipp/boundary-logs-api branch December 19, 2025 17:41
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants