Commit c7b4ac19 authored by Andreas Bigger's avatar Andreas Bigger

Update the op-proposer metrics to make fields unexported

parent 441e6e9f
...@@ -37,8 +37,8 @@ type Metrics struct { ...@@ -37,8 +37,8 @@ type Metrics struct {
opmetrics.RefMetrics opmetrics.RefMetrics
txmetrics.TxMetrics txmetrics.TxMetrics
Info prometheus.GaugeVec info prometheus.GaugeVec
Up prometheus.Gauge up prometheus.Gauge
} }
var _ Metricer = (*Metrics)(nil) var _ Metricer = (*Metrics)(nil)
...@@ -60,14 +60,14 @@ func NewMetrics(procName string) *Metrics { ...@@ -60,14 +60,14 @@ func NewMetrics(procName string) *Metrics {
RefMetrics: opmetrics.MakeRefMetrics(ns, factory), RefMetrics: opmetrics.MakeRefMetrics(ns, factory),
TxMetrics: txmetrics.MakeTxMetrics(ns, factory), TxMetrics: txmetrics.MakeTxMetrics(ns, factory),
Info: *factory.NewGaugeVec(prometheus.GaugeOpts{ info: *factory.NewGaugeVec(prometheus.GaugeOpts{
Namespace: ns, Namespace: ns,
Name: "info", Name: "info",
Help: "Pseudo-metric tracking version and config info", Help: "Pseudo-metric tracking version and config info",
}, []string{ }, []string{
"version", "version",
}), }),
Up: factory.NewGauge(prometheus.GaugeOpts{ up: factory.NewGauge(prometheus.GaugeOpts{
Namespace: ns, Namespace: ns,
Name: "up", Name: "up",
Help: "1 if the op-proposer has finished starting up", Help: "1 if the op-proposer has finished starting up",
...@@ -87,13 +87,13 @@ func (m *Metrics) StartBalanceMetrics(ctx context.Context, ...@@ -87,13 +87,13 @@ func (m *Metrics) StartBalanceMetrics(ctx context.Context,
// RecordInfo sets a pseudo-metric that contains versioning and // RecordInfo sets a pseudo-metric that contains versioning and
// config info for the op-proposer. // config info for the op-proposer.
func (m *Metrics) RecordInfo(version string) { func (m *Metrics) RecordInfo(version string) {
m.Info.WithLabelValues(version).Set(1) m.info.WithLabelValues(version).Set(1)
} }
// RecordUp sets the up metric to 1. // RecordUp sets the up metric to 1.
func (m *Metrics) RecordUp() { func (m *Metrics) RecordUp() {
prometheus.MustRegister() prometheus.MustRegister()
m.Up.Set(1) m.up.Set(1)
} }
const ( const (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment