diff --git a/enterprise/coderd/proxyhealth/proxyhealth.go b/enterprise/coderd/proxyhealth/proxyhealth.go index 9f3abdac849f2..f4014e398135b 100644 --- a/enterprise/coderd/proxyhealth/proxyhealth.go +++ b/enterprise/coderd/proxyhealth/proxyhealth.go @@ -215,7 +215,7 @@ func (p *ProxyHealth) ProxyHosts() []string { // unreachable. func (p *ProxyHealth) runOnce(ctx context.Context, now time.Time) (map[uuid.UUID]ProxyStatus, error) { // Record from the given time. - defer p.healthCheckDuration.Observe(time.Since(now).Seconds()) + defer func() { p.healthCheckDuration.Observe(time.Since(now).Seconds()) }() //nolint:gocritic // Proxy health is a system service. proxies, err := p.db.GetWorkspaceProxies(dbauthz.AsSystemRestricted(ctx))