feat: add telemetry support for workspace agent subsystem (#7579)

This commit is contained in:
Jon Ayers
2023-05-17 22:49:25 -05:00
committed by GitHub
parent 52bb84a26f
commit 00a2413c03
26 changed files with 366 additions and 27 deletions
+3 -2
View File
@@ -544,8 +544,9 @@ func (c *Client) PostLifecycle(ctx context.Context, req PostLifecycleRequest) er
}
type PostStartupRequest struct {
Version string `json:"version"`
ExpandedDirectory string `json:"expanded_directory"`
Version string `json:"version"`
ExpandedDirectory string `json:"expanded_directory"`
Subsystem codersdk.AgentSubsystem `json:"subsystem"`
}
func (c *Client) PostStartup(ctx context.Context, req PostStartupRequest) error {
+10 -3
View File
@@ -130,9 +130,10 @@ type WorkspaceAgent struct {
// LoginBeforeReady if true, the agent will delay logins until it is ready (e.g. executing startup script has ended).
LoginBeforeReady bool `json:"login_before_ready"`
// StartupScriptTimeoutSeconds is the number of seconds to wait for the startup script to complete. If the script does not complete within this time, the agent lifecycle will be marked as start_timeout.
StartupScriptTimeoutSeconds int32 `json:"startup_script_timeout_seconds"`
ShutdownScript string `json:"shutdown_script,omitempty"`
ShutdownScriptTimeoutSeconds int32 `json:"shutdown_script_timeout_seconds"`
StartupScriptTimeoutSeconds int32 `json:"startup_script_timeout_seconds"`
ShutdownScript string `json:"shutdown_script,omitempty"`
ShutdownScriptTimeoutSeconds int32 `json:"shutdown_script_timeout_seconds"`
Subsystem AgentSubsystem `json:"subsystem"`
}
type DERPRegion struct {
@@ -553,3 +554,9 @@ type WorkspaceAgentStartupLog struct {
Output string `json:"output"`
Level LogLevel `json:"level"`
}
type AgentSubsystem string
const (
AgentSubsystemEnvbox AgentSubsystem = "envbox"
)