-
Notifications
You must be signed in to change notification settings - Fork 897
chore: rename startup logs to agent logs #8649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This also adds a `source` property to every agent log. It should allow us to group logs and display them nicer in the UI as they stream in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this change and that you went the extra mile with renaming code in the site as well!
Feel free to defer my suggestion about limit/source, as it's not critical for this refactor.
Didn't see any blockers so I'm approving. 👍🏻
@@ -757,7 +757,8 @@ func New(options *Options) *API { | |||
// New agents will use /me/manifest instead. | |||
r.Get("/metadata", api.workspaceAgentManifest) | |||
r.Post("/startup", api.postWorkspaceAgentStartup) | |||
r.Patch("/startup-logs", api.patchWorkspaceAgentStartupLogs) | |||
r.Patch("/startup-logs", api.patchWorkspaceAgentLogsDeprecated) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
CREATE TYPE workspace_agent_log_source AS ENUM ('startup_script', 'kubernetes_logs', 'envbox', 'envbuilder', 'external'); | ||
ALTER TABLE workspace_agent_startup_logs RENAME TO workspace_agent_logs; | ||
ALTER TABLE workspace_agent_logs ADD COLUMN source workspace_agent_log_source NOT NULL DEFAULT 'startup_script'; | ||
ALTER TABLE workspace_agents RENAME COLUMN startup_logs_overflowed TO logs_overflowed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we change this to be a limit/source? For instance, I'd like for us to start sending shutdown logs as well in the future, but if the log overflowed from one of the others, then we'd essentially lose that information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, that's a good point. I will change this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll do this later. I was considering doing this with a jsonb column mapping sources to sizes, but it felt a bit wonky. Any ideas here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a jsonb column, or a separate table (agent_id
, log_source
, size
) (classic relational structure) would be fine. 👍🏻 In the relational variant we could move the overflow boolean to this new table as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to do this after. Good idea!
coderd/database/migrations/000141_workspace_agent_logs.down.sql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two more things 😄
This also adds a
source
property to every agent log. It should allow us to group logs and display them nicer in the UI as they stream in.