Skip to content

Commit 5bdf62c

Browse files
committed
feat: use ready_for_use to gate onboarding instead of status
The control plane now exposes ready_for_use (boolean) which indicates when an account has enough data for a good first experience (50+ log events saved). Changes: - Add readyForUse and logSavedCount to GraphQL query and domain type - isComplete() now checks ready_for_use instead of status == READY - Progress shows saved_count/50 instead of service counts - BROKEN status is a warning, not an error - users can still proceed - debug status command shows onboarding readiness info
1 parent 1d55c14 commit 5bdf62c

12 files changed

Lines changed: 150 additions & 122 deletions

File tree

‎internal/api/datadog_account_service.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ type DatadogAccountStatus struct {
5656
BrokenServices int
5757
DisabledServices int
5858
InactiveServices int
59+
SavedCount int // Number of log events saved (for progress display)
60+
ReadyForUse bool // Whether the account has enough data to proceed
5961
}
6062

6163
// HasAccount checks if an account has a Datadog integration configured
@@ -201,6 +203,8 @@ func (s *DatadogAccountService) GetStatus(ctx context.Context, datadogAccountID
201203
BrokenServices: statusNode.LogBrokenServices,
202204
DisabledServices: statusNode.LogDisabledServices,
203205
InactiveServices: statusNode.LogInactiveServices,
206+
SavedCount: statusNode.LogSavedCount,
207+
ReadyForUse: statusNode.ReadyForUse,
204208
}
205209

206210
s.logger.Debug("fetched datadog account status",

‎internal/cmd/debug.go‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,16 @@ func newDebugStatusCmd(logger log.Logger, cliConfig *config.CLIConfig) *cobra.Co
111111
fmt.Printf(" %-25s %s\n", s.Help.Render("Service Volume:"), s.Body.Render(fmt.Sprintf("%d", ddStatus.ServiceLogVolume)))
112112
fmt.Printf(" %-25s %s\n", s.Help.Render("Discovered Volume:"), s.Body.Render(fmt.Sprintf("%d", ddStatus.DiscoveredLogVolume)))
113113

114-
// Show completion check
114+
// Show onboarding readiness
115115
fmt.Println()
116-
fmt.Println(s.Title.Render("Completion Check"))
117-
terminalServices := ddStatus.ReadyServices + ddStatus.BrokenServices
118-
allTerminal := terminalServices == ddStatus.ActiveServices
119-
fmt.Printf(" %-25s %s\n", s.Help.Render("Terminal Services:"), s.Body.Render(fmt.Sprintf("%d / %d active", terminalServices, ddStatus.ActiveServices)))
120-
fmt.Printf(" %-25s %s\n", s.Help.Render("All Terminal:"), s.Body.Render(fmt.Sprintf("%v", allTerminal)))
121-
fmt.Printf(" %-25s %s\n", s.Help.Render("Can Proceed:"), s.Body.Render(fmt.Sprintf("%v", allTerminal && ddStatus.ReadyServices > 0)))
116+
fmt.Println(s.Title.Render("Onboarding"))
117+
fmt.Printf(" %-25s %s\n", s.Help.Render("Saved Count:"), s.Body.Render(fmt.Sprintf("%d / 50", ddStatus.SavedCount)))
118+
readyForUseStr := fmt.Sprintf("%v", ddStatus.ReadyForUse)
119+
if ddStatus.ReadyForUse {
120+
fmt.Printf(" %-25s %s\n", s.Help.Render("Ready for Use:"), s.Success.Render(readyForUseStr))
121+
} else {
122+
fmt.Printf(" %-25s %s\n", s.Help.Render("Ready for Use:"), s.Body.Render(readyForUseStr))
123+
}
122124

123125
return nil
124126
},

‎internal/powersync/schema.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"tables":[{"name":"conversations","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"created_at","type":"text"},{"name":"updated_at","type":"text"},{"name":"user_id","type":"text"},{"name":"workspace_id","type":"text"}]},{"name":"datadog_account_statuses_cache","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"datadog_account_id","type":"text"},{"name":"log_active_services","type":"integer"},{"name":"log_analyzing_count","type":"integer"},{"name":"log_analyzing_services","type":"integer"},{"name":"log_broken_services","type":"integer"},{"name":"log_disabled_services","type":"integer"},{"name":"log_discovered_volume","type":"integer"},{"name":"log_discovering_count","type":"integer"},{"name":"log_discovering_services","type":"integer"},{"name":"log_error","type":"text"},{"name":"log_error_at","type":"text"},{"name":"log_event_count","type":"integer"},{"name":"log_inactive_services","type":"integer"},{"name":"log_percent_complete","type":"real"},{"name":"log_ready_services","type":"integer"},{"name":"log_saved_count","type":"integer"},{"name":"log_service_count","type":"integer"},{"name":"log_service_volume","type":"integer"},{"name":"log_stale_services","type":"integer"},{"name":"log_status","type":"text"},{"name":"log_valuable_count","type":"integer"},{"name":"log_warning","type":"text"},{"name":"log_warning_at","type":"text"},{"name":"log_waste_count","type":"integer"},{"name":"refreshed_at","type":"text"}]},{"name":"datadog_accounts","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"created_at","type":"text"},{"name":"name","type":"text"},{"name":"site","type":"text"},{"name":"updated_at","type":"text"}]},{"name":"datadog_log_indexes","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"created_at","type":"text"},{"name":"datadog_account_id","type":"text"},{"name":"last_seen_at","type":"text"},{"name":"name","type":"text"}]},{"name":"discovery_statuses","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"completed_at","type":"text"},{"name":"consecutive_errors","type":"integer"},{"name":"consecutive_warnings","type":"integer"},{"name":"created_at","type":"text"},{"name":"datadog_account_id","type":"text"},{"name":"discovery_type","type":"text"},{"name":"last_error","type":"text"},{"name":"last_error_at","type":"text"},{"name":"last_warning","type":"text"},{"name":"last_warning_at","type":"text"},{"name":"service_id","type":"text"},{"name":"started_at","type":"text"},{"name":"updated_at","type":"text"}]},{"name":"log_event_policies","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"analysis","type":"text"},{"name":"approved_at","type":"text"},{"name":"approved_by","type":"text"},{"name":"category","type":"text"},{"name":"created_at","type":"text"},{"name":"dismissed_at","type":"text"},{"name":"dismissed_by","type":"text"},{"name":"log_event_id","type":"text"},{"name":"model","type":"text"},{"name":"updated_at","type":"text"},{"name":"workspace_id","type":"text"}]},{"name":"log_event_policy_statuses_cache","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"approved_at","type":"text"},{"name":"bytes_saved","type":"real"},{"name":"category","type":"text"},{"name":"dismissed_at","type":"text"},{"name":"log_event_id","type":"text"},{"name":"policy_id","type":"text"},{"name":"refreshed_at","type":"text"},{"name":"status","type":"text"},{"name":"volume_saved","type":"real"},{"name":"workspace_id","type":"text"}]},{"name":"log_event_statuses_cache","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"bytes_after","type":"real"},{"name":"bytes_before","type":"real"},{"name":"datadog_account_id","type":"text"},{"name":"error","type":"text"},{"name":"has_been_analyzed","type":"integer"},{"name":"has_volumes","type":"integer"},{"name":"log_event_id","type":"text"},{"name":"refreshed_at","type":"text"},{"name":"service_id","type":"text"},{"name":"status","type":"text"},{"name":"volume_after","type":"real"},{"name":"volume_before","type":"real"}]},{"name":"log_event_volumes","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"attribute_avg_bytes","type":"text"},{"name":"avg_bytes","type":"real"},{"name":"count","type":"real"},{"name":"created_at","type":"text"},{"name":"datadog_log_index_id","type":"text"},{"name":"edge_instance_id","type":"text"},{"name":"log_event_id","type":"text"},{"name":"timestamp","type":"text"}]},{"name":"log_events","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"analyzed_at","type":"text"},{"name":"created_at","type":"text"},{"name":"description","type":"text"},{"name":"examples","type":"text"},{"name":"matchers","type":"text"},{"name":"name","type":"text"},{"name":"service_id","type":"text"},{"name":"updated_at","type":"text"}]},{"name":"messages","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"content","type":"text"},{"name":"conversation_id","type":"text"},{"name":"created_at","type":"text"},{"name":"role","type":"text"},{"name":"stop_reason","type":"text"}]},{"name":"service_log_volumes","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"created_at","type":"text"},{"name":"datadog_account_id","type":"text"},{"name":"service_id","type":"text"},{"name":"timestamp","type":"text"},{"name":"updated_at","type":"text"},{"name":"volume","type":"integer"}]},{"name":"service_statuses_cache","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"datadog_account_id","type":"text"},{"name":"log_analyzing_count","type":"integer"},{"name":"log_bytes_after","type":"real"},{"name":"log_bytes_before","type":"real"},{"name":"log_discovered_volume","type":"integer"},{"name":"log_discovering_count","type":"integer"},{"name":"log_error","type":"text"},{"name":"log_error_at","type":"text"},{"name":"log_event_count","type":"integer"},{"name":"log_percent_complete","type":"real"},{"name":"log_saved_count","type":"integer"},{"name":"log_service_volume","type":"integer"},{"name":"log_status","type":"text"},{"name":"log_valuable_count","type":"integer"},{"name":"log_volume_after","type":"real"},{"name":"log_volume_before","type":"real"},{"name":"log_warning","type":"text"},{"name":"log_warning_at","type":"text"},{"name":"log_waste_count","type":"integer"},{"name":"refreshed_at","type":"text"},{"name":"service_id","type":"text"}]},{"name":"services","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"created_at","type":"text"},{"name":"description","type":"text"},{"name":"enabled","type":"integer"},{"name":"initial_weekly_log_count","type":"integer"},{"name":"name","type":"text"},{"name":"updated_at","type":"text"}]},{"name":"teams","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"created_at","type":"text"},{"name":"name","type":"text"},{"name":"updated_at","type":"text"},{"name":"workspace_id","type":"text"}]},{"name":"workspaces","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"created_at","type":"text"},{"name":"name","type":"text"},{"name":"purpose","type":"text"},{"name":"updated_at","type":"text"}]}]}
1+
{"tables":[{"name":"conversation_contexts","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"added_by","type":"text"},{"name":"conversation_id","type":"text"},{"name":"created_at","type":"text"},{"name":"entity_id","type":"text"},{"name":"entity_type","type":"text"}]},{"name":"conversations","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"created_at","type":"text"},{"name":"title","type":"text"},{"name":"updated_at","type":"text"},{"name":"user_id","type":"text"},{"name":"workspace_id","type":"text"}]},{"name":"datadog_account_statuses_cache","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"datadog_account_id","type":"text"},{"name":"log_active_services","type":"integer"},{"name":"log_analyzing_count","type":"integer"},{"name":"log_analyzing_services","type":"integer"},{"name":"log_broken_services","type":"integer"},{"name":"log_disabled_services","type":"integer"},{"name":"log_discovered_volume","type":"text"},{"name":"log_discovering_count","type":"integer"},{"name":"log_discovering_services","type":"integer"},{"name":"log_error","type":"text"},{"name":"log_error_at","type":"text"},{"name":"log_event_count","type":"integer"},{"name":"log_inactive_services","type":"integer"},{"name":"log_percent_complete","type":"real"},{"name":"log_ready_services","type":"integer"},{"name":"log_saved_count","type":"integer"},{"name":"log_service_count","type":"integer"},{"name":"log_service_volume","type":"text"},{"name":"log_stale_services","type":"integer"},{"name":"log_status","type":"text"},{"name":"log_valuable_count","type":"integer"},{"name":"log_warning","type":"text"},{"name":"log_warning_at","type":"text"},{"name":"log_waste_count","type":"integer"},{"name":"refreshed_at","type":"text"}]},{"name":"datadog_accounts","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"created_at","type":"text"},{"name":"name","type":"text"},{"name":"site","type":"text"},{"name":"updated_at","type":"text"}]},{"name":"datadog_log_indexes","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"created_at","type":"text"},{"name":"datadog_account_id","type":"text"},{"name":"last_seen_at","type":"text"},{"name":"name","type":"text"}]},{"name":"discovery_statuses","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"completed_at","type":"text"},{"name":"consecutive_errors","type":"integer"},{"name":"consecutive_warnings","type":"integer"},{"name":"created_at","type":"text"},{"name":"datadog_account_id","type":"text"},{"name":"discovery_type","type":"text"},{"name":"last_error","type":"text"},{"name":"last_error_at","type":"text"},{"name":"last_warning","type":"text"},{"name":"last_warning_at","type":"text"},{"name":"service_id","type":"text"},{"name":"started_at","type":"text"},{"name":"updated_at","type":"text"}]},{"name":"log_event_policies","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"analysis","type":"text"},{"name":"approved_at","type":"text"},{"name":"approved_by","type":"text"},{"name":"category","type":"text"},{"name":"created_at","type":"text"},{"name":"dismissed_at","type":"text"},{"name":"dismissed_by","type":"text"},{"name":"log_event_id","type":"text"},{"name":"model","type":"text"},{"name":"updated_at","type":"text"},{"name":"workspace_id","type":"text"}]},{"name":"log_event_policy_statuses_cache","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"approved_at","type":"text"},{"name":"bytes_saved","type":"text"},{"name":"category","type":"text"},{"name":"dismissed_at","type":"text"},{"name":"log_event_id","type":"text"},{"name":"policy_id","type":"text"},{"name":"refreshed_at","type":"text"},{"name":"status","type":"text"},{"name":"volume_saved","type":"text"},{"name":"workspace_id","type":"text"}]},{"name":"log_event_statuses_cache","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"bytes_after","type":"text"},{"name":"bytes_before","type":"text"},{"name":"datadog_account_id","type":"text"},{"name":"error","type":"text"},{"name":"has_been_analyzed","type":"integer"},{"name":"has_volumes","type":"integer"},{"name":"log_event_id","type":"text"},{"name":"refreshed_at","type":"text"},{"name":"service_id","type":"text"},{"name":"status","type":"text"},{"name":"volume_after","type":"text"},{"name":"volume_before","type":"text"}]},{"name":"log_event_volumes","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"attribute_avg_bytes","type":"text"},{"name":"avg_bytes","type":"real"},{"name":"count","type":"text"},{"name":"created_at","type":"text"},{"name":"datadog_log_index_id","type":"text"},{"name":"edge_instance_id","type":"text"},{"name":"log_event_id","type":"text"},{"name":"timestamp","type":"text"}]},{"name":"log_events","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"analyzed_at","type":"text"},{"name":"created_at","type":"text"},{"name":"description","type":"text"},{"name":"examples","type":"text"},{"name":"matchers","type":"text"},{"name":"name","type":"text"},{"name":"service_id","type":"text"},{"name":"updated_at","type":"text"}]},{"name":"messages","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"content","type":"text"},{"name":"conversation_id","type":"text"},{"name":"created_at","type":"text"},{"name":"model","type":"text"},{"name":"role","type":"text"},{"name":"stop_reason","type":"text"}]},{"name":"service_log_volumes","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"created_at","type":"text"},{"name":"datadog_account_id","type":"text"},{"name":"service_id","type":"text"},{"name":"timestamp","type":"text"},{"name":"updated_at","type":"text"},{"name":"volume","type":"text"}]},{"name":"service_statuses_cache","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"datadog_account_id","type":"text"},{"name":"log_analyzing_count","type":"integer"},{"name":"log_bytes_after","type":"text"},{"name":"log_bytes_before","type":"text"},{"name":"log_discovered_volume","type":"text"},{"name":"log_discovering_count","type":"integer"},{"name":"log_error","type":"text"},{"name":"log_error_at","type":"text"},{"name":"log_event_count","type":"integer"},{"name":"log_percent_complete","type":"real"},{"name":"log_saved_count","type":"integer"},{"name":"log_service_volume","type":"text"},{"name":"log_status","type":"text"},{"name":"log_valuable_count","type":"integer"},{"name":"log_volume_after","type":"text"},{"name":"log_volume_before","type":"text"},{"name":"log_warning","type":"text"},{"name":"log_warning_at","type":"text"},{"name":"log_waste_count","type":"integer"},{"name":"refreshed_at","type":"text"},{"name":"service_id","type":"text"}]},{"name":"services","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"created_at","type":"text"},{"name":"description","type":"text"},{"name":"enabled","type":"integer"},{"name":"initial_weekly_log_count","type":"integer"},{"name":"name","type":"text"},{"name":"updated_at","type":"text"}]},{"name":"teams","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"created_at","type":"text"},{"name":"name","type":"text"},{"name":"updated_at","type":"text"},{"name":"workspace_id","type":"text"}]},{"name":"workspaces","columns":[{"name":"id","type":"text"},{"name":"account_id","type":"text"},{"name":"created_at","type":"text"},{"name":"name","type":"text"},{"name":"purpose","type":"text"},{"name":"updated_at","type":"text"}]}]}

‎internal/sqlite/conversations.sql.go‎

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)