diff --git a/internal/analytics/types.go b/internal/analytics/types.go index 6a070e67be28..1b184f434472 100644 --- a/internal/analytics/types.go +++ b/internal/analytics/types.go @@ -18,6 +18,7 @@ type RequestEvent struct { } type BeaconEvent struct { + Name string `json:"name"` Version string `json:"version"` Browser string `json:"browser"` AuthProvider string `json:"authProvider"` @@ -28,4 +29,5 @@ type BeaconEvent struct { HasCustomBase bool `json:"hasCustomBase"` HasHostname bool `json:"hasHostname"` RunningContainers int `json:"runningContainers"` + HasActions bool `json:"hasActions"` } diff --git a/internal/web/events.go b/internal/web/events.go index 08695bd20068..0d0a8ac34730 100644 --- a/internal/web/events.go +++ b/internal/web/events.go @@ -35,6 +35,7 @@ func (h *handler) streamEvents(w http.ResponseWriter, r *http.Request) { pages, _ := content.ReadAll() b := analytics.BeaconEvent{ + Name: "events", Version: h.config.Version, Browser: r.Header.Get("User-Agent"), AuthProvider: string(h.config.Authorization.Provider), @@ -43,6 +44,7 @@ func (h *handler) streamEvents(w http.ResponseWriter, r *http.Request) { HasCustomAddress: h.config.Addr != ":8080", Clients: len(h.clients), HasDocumentation: len(pages) > 0, + HasActions: h.config.EnableActions, } { diff --git a/main.go b/main.go index b686db8288bd..f7224af4cf5e 100644 --- a/main.go +++ b/main.go @@ -117,24 +117,13 @@ func doStartEvent(arg args) { log.Debug("Analytics disabled.") return } - host, err := os.Hostname() - if err != nil { - log.Debug(err) - return - } - event := analytics.StartEvent{ - ClientId: host, - Version: version, - FilterLength: len(arg.Filter), - CustomAddress: arg.Addr != ":8080", - CustomBase: arg.Base != "/", - RemoteHostLength: len(arg.RemoteHost), - Protected: arg.Username != "", - HasHostname: arg.Hostname != "", + event := analytics.BeaconEvent{ + Name: "start", + Version: version, } - if err := analytics.SendStartEvent(event); err != nil { + if err := analytics.SendBeacon(event); err != nil { log.Debug(err) } }