feat(coderd): add provisioner_daemons to /debug/health endpoint (#11393)

Adds a healthcheck for provisioner daemons to /debug/health endpoint.
This commit is contained in:
Cian Johnston
2024-01-08 09:29:04 +00:00
committed by GitHub
parent 31f8fac1b9
commit 04fd96a014
23 changed files with 791 additions and 94 deletions

View File

@ -440,6 +440,12 @@ func New(options *Options) *API {
CurrentVersion: buildinfo.Version(),
WorkspaceProxiesFetchUpdater: *(options.WorkspaceProxiesFetchUpdater).Load(),
},
ProvisionerDaemons: healthcheck.ProvisionerDaemonsReportDeps{
CurrentVersion: buildinfo.Version(),
CurrentAPIMajorVersion: provisionersdk.CurrentMajor,
Store: options.Database,
// TimeNow and StaleInterval set to defaults, see healthcheck/provisioner.go
},
})
}
}
@ -1188,7 +1194,7 @@ func (api *API) CreateInMemoryProvisionerDaemon(ctx context.Context, name string
Tags: provisionersdk.MutateTags(uuid.Nil, nil),
LastSeenAt: sql.NullTime{Time: dbtime.Now(), Valid: true},
Version: buildinfo.Version(),
APIVersion: provisionersdk.APIVersionCurrent,
APIVersion: provisionersdk.VersionCurrent.String(),
})
if err != nil {
return nil, xerrors.Errorf("failed to create in-memory provisioner daemon: %w", err)