frostfs-node/internal/metrics/application.go
Alexander Chuprov 87a4a6e8d0 [#1154] node: Add info metric
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2024-06-27 12:02:52 +00: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
}