-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Email subscription drop rate #5145
Conversation
pkg/api/controller.go
Outdated
@@ -3511,9 +3511,13 @@ func (c *Controller) GetSetupState(w http.ResponseWriter, r *http.Request) { | |||
writeError(w, r, http.StatusInternalServerError, err) | |||
return | |||
} | |||
|
|||
if savedState == auth.SetupStateNotInitialized { | |||
c.Collector.CollectEvent(stats.Event{Class: "global", Name: "preinit", Client: httputil.GetRequestLakeFSClient(r)}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new metric you understand how many users are still in preinit state?
The call for GetSetupState is called many names - each login if I remember to understand if we need to redirect the user to the setup flow.
The problem will be that for external API we always in not initialized mode and we will get this event on all checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - added suggestion for the condition check
pkg/api/controller.go
Outdated
@@ -3511,6 +3511,10 @@ func (c *Controller) GetSetupState(w http.ResponseWriter, r *http.Request) { | |||
writeError(w, r, http.StatusInternalServerError, err) | |||
return | |||
} | |||
|
|||
if !c.Config.IsAuthTypeAPI() && savedState == auth.SetupStateNotInitialized { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to merge the two condition into if/else
state := string(savedState)
// no need to create an admin user if users are managed externally
if c.Config.IsAuthTypeAPI() {
state = string(auth.SetupStateInitialized)
} else if savedState == auth.SetupStateNotInitialized {
c.Collector.CollectEvent(stats.Event{Class: "global", Name: "preinit", Client: httputil.GetRequestLakeFSClient(r)})
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks!
15a15a7
to
4076dc0
Compare
Resolves #4958