Usage stats: Adds source/distributor setting (#31039)

Signed-off-by: bergquist <carl.bergquist@gmail.com>
This commit is contained in:
Carl Bergquist
2021-02-10 10:07:32 +01:00
committed by GitHub
parent d6e8e47698
commit d1b9fddb4f
5 changed files with 20 additions and 5 deletions
+11 -5
View File
@@ -141,10 +141,12 @@ var (
appliedCommandLineProperties []string
appliedEnvOverrides []string
ReportingEnabled bool
CheckForUpdates bool
GoogleAnalyticsId string
GoogleTagManagerId string
// analytics
ReportingEnabled bool
ReportingDistributor string
CheckForUpdates bool
GoogleAnalyticsId string
GoogleTagManagerId string
// LDAP
LDAPEnabled bool
@@ -815,10 +817,14 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
cfg.MetricsEndpointDisableTotalStats = iniFile.Section("metrics").Key("disable_total_stats").MustBool(false)
analytics := iniFile.Section("analytics")
ReportingEnabled = analytics.Key("reporting_enabled").MustBool(true)
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]
}
if err := readAlertingSettings(iniFile); err != nil {
return err