Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
c7b4ac19
Commit
c7b4ac19
authored
May 04, 2023
by
Andreas Bigger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the op-proposer metrics to make fields unexported
parent
441e6e9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
metrics.go
op-proposer/metrics/metrics.go
+6
-6
No files found.
op-proposer/metrics/metrics.go
View file @
c7b4ac19
...
@@ -37,8 +37,8 @@ type Metrics struct {
...
@@ -37,8 +37,8 @@ type Metrics struct {
opmetrics
.
RefMetrics
opmetrics
.
RefMetrics
txmetrics
.
TxMetrics
txmetrics
.
TxMetrics
I
nfo
prometheus
.
GaugeVec
i
nfo
prometheus
.
GaugeVec
U
p
prometheus
.
Gauge
u
p
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
),
I
nfo
:
*
factory
.
NewGaugeVec
(
prometheus
.
GaugeOpts
{
i
nfo
:
*
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"
,
}),
}),
U
p
:
factory
.
NewGauge
(
prometheus
.
GaugeOpts
{
u
p
:
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
.
I
nfo
.
WithLabelValues
(
version
)
.
Set
(
1
)
m
.
i
nfo
.
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
.
U
p
.
Set
(
1
)
m
.
u
p
.
Set
(
1
)
}
}
const
(
const
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment