mirror of
https://github.com/luxfi/vm.git
synced 2026-10-30 15:13:40 +00:00
27 lines
726 B
Go
27 lines
726 B
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package health
|
|
|
|
import "github.com/luxfi/metric"
|
|
|
|
type healthMetrics struct {
|
|
// failingChecks keeps track of the number of check failing
|
|
failingChecks metric.GaugeVec
|
|
}
|
|
|
|
func newMetrics(namespace string, registry metric.Registry) (*healthMetrics, error) {
|
|
metricsInstance := metric.NewWithRegistry(namespace, registry)
|
|
|
|
m := &healthMetrics{
|
|
failingChecks: metricsInstance.NewGaugeVec(
|
|
"checks_failing",
|
|
"number of currently failing health checks",
|
|
[]string{"tag"},
|
|
),
|
|
}
|
|
m.failingChecks.WithLabelValues(AllTag).Set(0)
|
|
m.failingChecks.WithLabelValues(ApplicationTag).Set(0)
|
|
return m, nil
|
|
}
|