Skip to content

An open-source, faster Devin alternative

TypeScript

Fix/populator wait cloud init (#251)

Mohamed Habib5c1c4e14c481
diff --git a/cmd/worker/main.go b/cmd/worker/main.go
index bf0747c5..5fb7c936 100644
--- a/cmd/worker/main.go
+++ b/cmd/worker/main.go
@@ -499,6 +499,13 @@ func main() {
defer metricsSrv.Close()
log.Println("opensandbox-worker: metrics server started on :9091")
+ // Pre-warm the checkpoint-failures counter with a synthetic
+ // (region, "all", "none") row so the dashboard panel renders 0 instead of
+ // "field not found" before any failure has occurred. Real failures use the
+ // actual template + classified reason — the heartbeat row is independent
+ // and stays at 0 forever.
+ metrics.CheckpointFailuresTotal.WithLabelValues(cfg.Region, "all", "none").Add(0)
+
// Periodic resource-stats sampler: disk bytes (used/avail/total on the
// data mount), memory bytes (total/avail from /proc/meminfo), allocated
// memory (sum of MemoryMB across running VMs), CPU pressure (PSI 'some'
diff --git a/internal/auth/oauth_handlers.go b/internal/auth/oauth_handlers.go
index 19d82668..750434ad 100644
--- a/internal/auth/oauth_handlers.go
+++ b/internal/auth/oauth_handlers.go
@@ -27,7 +27,14 @@ type OAuthHandlers struct {
}
// NewOAuthHandlers creates new OAuth handlers.
+//
+// Pre-warms the auth_attempts_total counter for both known result values so
+// the dashboard panel renders 0 instead of "field not found" before any login
+// has happened. Add(0) materializes the time series at zero without affecting
+// the count once real attempts arrive.
func NewOAuthHandlers(workos *WorkOSMiddleware) *OAuthHandlers {
+ metrics.AuthAttemptsTotal.WithLabelValues(authTypeWorkOS, "success").Add(0)
+ metrics.AuthAttemptsTotal.WithLabelValues(authTypeWorkOS, "failure").Add(0)
return &OAuthHandlers{workos: workos}
}