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

Signed-off-by: bergquist <carl.bergquist@gmail.com>
(cherry picked from commit d1b9fddb4f)

Co-authored-by: Carl Bergquist <carl.bergquist@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2021-02-10 11:08:14 +01:00
committed by GitHub
co-authored by Carl Bergquist
parent 97f8bc7250
commit 368bd2d7bb
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