[#412] node: Replace metrics package
Use observability module. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
74578052f9
commit
c09144ecf1
15 changed files with 162 additions and 459 deletions
|
@ -1,16 +1,19 @@
|
|||
package metrics
|
||||
|
||||
import "github.com/prometheus/client_golang/prometheus"
|
||||
import (
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-observability/metrics"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
const stateSubsystem = "state"
|
||||
|
||||
type stateMetrics struct {
|
||||
healthCheck metric[prometheus.Gauge]
|
||||
healthCheck prometheus.Gauge
|
||||
}
|
||||
|
||||
func newStateMetrics() stateMetrics {
|
||||
return stateMetrics{
|
||||
healthCheck: newGauge(prometheus.GaugeOpts{
|
||||
healthCheck: metrics.NewGauge(prometheus.GaugeOpts{
|
||||
Namespace: namespace,
|
||||
Subsystem: stateSubsystem,
|
||||
Name: "health",
|
||||
|
@ -19,10 +22,6 @@ func newStateMetrics() stateMetrics {
|
|||
}
|
||||
}
|
||||
|
||||
func (m stateMetrics) register() {
|
||||
mustRegister(m.healthCheck)
|
||||
}
|
||||
|
||||
func (m stateMetrics) SetHealth(s int32) {
|
||||
m.healthCheck.value.Set(float64(s))
|
||||
m.healthCheck.Set(float64(s))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue