mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Usage stats: Tune collector execution startup and interval (#72688)
* Do not update statistics at service collector startup * Configurable collector interval * Introduce initial random delay * Prevent reporting metrics until the stats have been collected * Apply suggestion from code review
This commit is contained in:
committed by
GitHub
parent
ba723c911a
commit
afb59af79b
@@ -256,6 +256,7 @@ type Cfg struct {
|
||||
MetricsEndpointBasicAuthUsername string
|
||||
MetricsEndpointBasicAuthPassword string
|
||||
MetricsEndpointDisableTotalStats bool
|
||||
MetricsTotalStatsIntervalSeconds int
|
||||
MetricsGrafanaEnvironmentInfo map[string]string
|
||||
|
||||
// Dashboards
|
||||
@@ -1085,6 +1086,7 @@ func (cfg *Cfg) Load(args CommandLineArgs) error {
|
||||
cfg.MetricsEndpointBasicAuthUsername = valueAsString(iniFile.Section("metrics"), "basic_auth_username", "")
|
||||
cfg.MetricsEndpointBasicAuthPassword = valueAsString(iniFile.Section("metrics"), "basic_auth_password", "")
|
||||
cfg.MetricsEndpointDisableTotalStats = iniFile.Section("metrics").Key("disable_total_stats").MustBool(false)
|
||||
cfg.MetricsTotalStatsIntervalSeconds = iniFile.Section("metrics").Key("total_stats_collector_interval_seconds").MustInt(1800)
|
||||
|
||||
analytics := iniFile.Section("analytics")
|
||||
cfg.CheckForGrafanaUpdates = analytics.Key("check_for_updates").MustBool(true)
|
||||
|
||||
Reference in New Issue
Block a user