[#1154] node: Add info metric

Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
Alexander Chuprov 2024-06-26 14:46:32 +03:00 committed by Evgenii Stratonikov
parent 4f7d76c9ef
commit 87a4a6e8d0
2 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,21 @@
package metrics
import (
"git.frostfs.info/TrueCloudLab/frostfs-observability/metrics"
"github.com/prometheus/client_golang/prometheus"
)
type ApplicationInfo struct {
versionValue *prometheus.GaugeVec
}
func NewApplicationInfo(version string) *ApplicationInfo {
appInfo := &ApplicationInfo{
versionValue: metrics.NewGaugeVec(prometheus.GaugeOpts{
Name: "app_info",
Help: "General information about the application.",
}, []string{"version"}),
}
appInfo.versionValue.With(prometheus.Labels{"version": version})
return appInfo
}