Aligned the Consul_version format to the existing

pull/18622/head
20sr20 1 year ago
parent ac91ea6a6f
commit deb1e7528c

@ -149,12 +149,26 @@ func (u *UsageMetricsReporter) emitConfigEntryUsage(configUsage state.ConfigEntr
}
}
func GetVersionWithMetadata() string {
version := consulversion.Version
metadata := consulversion.VersionMetadata
if metadata != "" {
version += "+" + metadata
}
return version
}
func (u *UsageMetricsReporter) emitVersionUsage() {
// consul version metric with labels
metrics.SetGaugeWithLabels(
[]string{"version"},
1,
append(u.metricLabels, metrics.Label{Name: "version", Value: consulversion.GetHumanVersion()}),
[]metrics.Label{
{Name: "version", Value: GetVersionWithMetadata()},
{Name: "pre_release", Value: consulversion.VersionPrerelease},
},
)
}

Loading…
Cancel
Save