Metrics: Add commit & version to grafana_environment_info (#79823)

pull/76155/head^2
Todd Treece 1 year ago committed by GitHub
parent b2b4d89501
commit feb7b38fba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      pkg/setting/setting.go

@ -677,6 +677,13 @@ func (cfg *Cfg) readGrafanaEnvironmentMetrics() error {
keys := environmentMetricsSection.Keys()
cfg.MetricsGrafanaEnvironmentInfo = make(map[string]string, len(keys))
cfg.MetricsGrafanaEnvironmentInfo["version"] = cfg.BuildVersion
cfg.MetricsGrafanaEnvironmentInfo["commit"] = cfg.BuildCommit
if cfg.EnterpriseBuildCommit != "NA" && cfg.EnterpriseBuildCommit != "" {
cfg.MetricsGrafanaEnvironmentInfo["enterprise_commit"] = cfg.EnterpriseBuildCommit
}
for _, key := range keys {
labelName := model.LabelName(key.Name())
labelValue := model.LabelValue(key.Value())

Loading…
Cancel
Save