mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 03:12:13 +08:00
UsageStatsService: Don't use global state (#31849)
* UsageStatsService: Don't use global state Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
@ -141,10 +141,8 @@ var (
|
||||
appliedEnvOverrides []string
|
||||
|
||||
// analytics
|
||||
ReportingEnabled bool
|
||||
ReportingDistributor string
|
||||
GoogleAnalyticsId string
|
||||
GoogleTagManagerId string
|
||||
GoogleAnalyticsId string
|
||||
GoogleTagManagerId string
|
||||
|
||||
// LDAP
|
||||
LDAPEnabled bool
|
||||
@ -337,7 +335,9 @@ type Cfg struct {
|
||||
Env string
|
||||
|
||||
// Analytics
|
||||
CheckForUpdates bool
|
||||
CheckForUpdates bool
|
||||
ReportingDistributor string
|
||||
ReportingEnabled bool
|
||||
|
||||
// LDAP
|
||||
LDAPEnabled bool
|
||||
@ -831,10 +831,10 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
|
||||
cfg.CheckForUpdates = analytics.Key("check_for_updates").MustBool(true)
|
||||
GoogleAnalyticsId = analytics.Key("google_analytics_ua_id").String()
|
||||
GoogleTagManagerId = analytics.Key("google_tag_manager_id").String()
|
||||
ReportingEnabled = analytics.Key("reporting_enabled").MustBool(true)
|
||||
ReportingDistributor = analytics.Key("reporting_distributor").MustString("grafana-labs")
|
||||
if len(ReportingDistributor) >= 100 {
|
||||
ReportingDistributor = ReportingDistributor[:100]
|
||||
cfg.ReportingEnabled = analytics.Key("reporting_enabled").MustBool(true)
|
||||
cfg.ReportingDistributor = analytics.Key("reporting_distributor").MustString("grafana-labs")
|
||||
if len(cfg.ReportingDistributor) >= 100 {
|
||||
cfg.ReportingDistributor = cfg.ReportingDistributor[:100]
|
||||
}
|
||||
|
||||
if err := readAlertingSettings(iniFile); err != nil {
|
||||
|
Reference in New Issue
Block a user