mirror of
https://github.com/grafana/grafana.git
synced 2024-11-22 08:56:43 -06:00
Metrics: Add commit & version to grafana_environment_info (#79823)
This commit is contained in:
parent
b2b4d89501
commit
feb7b38fba
@ -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…
Reference in New Issue
Block a user