Skip to content
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

Merged
merged 3 commits into from
Feb 1, 2023
Merged

Email subscription drop rate #5145

merged 3 commits into from
Feb 1, 2023

Conversation

eladlachmi
Copy link
Contributor

Resolves #4958

@eladlachmi eladlachmi requested a review from nopcoder January 31, 2023 09:53
@eladlachmi eladlachmi self-assigned this Jan 31, 2023
@eladlachmi eladlachmi added the include-changelog PR description should be included in next release changelog label Jan 31, 2023
@@ -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)})
Copy link
Contributor

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.

Copy link
Contributor

@nopcoder nopcoder left a 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

@@ -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 {
Copy link
Contributor

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)})
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include-changelog PR description should be included in next release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Email subscription drop rate
2 participants