frostfs-node/pkg/metrics/state.go

28 lines
551 B
Go
Raw Normal View History

package metrics
import (
"git.frostfs.info/TrueCloudLab/frostfs-observability/metrics"
"github.com/prometheus/client_golang/prometheus"
)
const stateSubsystem = "state"
type stateMetrics struct {
healthCheck prometheus.Gauge
}
func newStateMetrics() stateMetrics {
return stateMetrics{
healthCheck: metrics.NewGauge(prometheus.GaugeOpts{
Namespace: namespace,
Subsystem: stateSubsystem,
Name: "health",
Help: "Current Node state",
}),
}
}
func (m stateMetrics) SetHealth(s int32) {
m.healthCheck.Set(float64(s))
}