frostfs-node/internal/metrics/application.go
Alexander Chuprov 406272d52d [#1154] node: Add info metric
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2024-06-26 14:46:32 +03:00

21 lines
547 B
Go

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
}