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
4dda5247
Unverified
Commit
4dda5247
authored
Aug 11, 2022
by
Joshua Gutow
Committed by
GitHub
Aug 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-node: Add L1 reorg depth metrics (#3210)
parent
10593211
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
metrics.go
op-node/metrics/metrics.go
+11
-0
state.go
op-node/rollup/driver/state.go
+3
-0
No files found.
op-node/metrics/metrics.go
View file @
4dda5247
...
...
@@ -48,6 +48,7 @@ type Metrics struct {
SequencingErrorsTotal
prometheus
.
Counter
PublishingErrorsTotal
prometheus
.
Counter
Heads
*
prometheus
.
GaugeVec
L1ReorgDepth
prometheus
.
Histogram
TransactionsSequencedTotal
prometheus
.
Counter
...
...
@@ -165,6 +166,12 @@ func NewMetrics(procName string) *Metrics {
},
[]
string
{
"type"
,
}),
L1ReorgDepth
:
promauto
.
With
(
registry
)
.
NewHistogram
(
prometheus
.
HistogramOpts
{
Namespace
:
ns
,
Name
:
"l1_reorg_depth"
,
Buckets
:
[]
float64
{
0.5
,
1.5
,
2.5
,
3.5
,
4.5
,
5.5
,
6.5
,
7.5
,
8.5
,
9.5
,
10.5
,
20.5
,
50.5
,
100.5
},
Help
:
"Histogram of L1 Reorg Depths"
,
}),
TransactionsSequencedTotal
:
promauto
.
With
(
registry
)
.
NewGauge
(
prometheus
.
GaugeOpts
{
Namespace
:
ns
,
...
...
@@ -252,6 +259,10 @@ func (m *Metrics) RecordPipelineReset() {
m
.
LastPipelineResetUnix
.
Set
(
float64
(
time
.
Now
()
.
Unix
()))
}
func
(
m
*
Metrics
)
RecordL1ReorgDepth
(
d
uint64
)
{
m
.
L1ReorgDepth
.
Observe
(
float64
(
d
))
}
// Serve starts the metrics server on the given hostname and port.
// The server will be closed when the passed-in context is cancelled.
func
(
m
*
Metrics
)
Serve
(
ctx
context
.
Context
,
hostname
string
,
port
int
)
error
{
...
...
op-node/rollup/driver/state.go
View file @
4dda5247
...
...
@@ -155,6 +155,9 @@ func (s *state) handleNewL1Block(newL1Head eth.L1BlockRef) {
// dealing with a linear extension (new block is the immediate child of the old one).
s
.
log
.
Debug
(
"L1 head moved forward"
,
"l1Head"
,
newL1Head
)
}
else
{
if
s
.
l1Head
.
Number
>=
newL1Head
.
Number
{
s
.
metrics
.
RecordL1ReorgDepth
(
s
.
l1Head
.
Number
-
newL1Head
.
Number
)
}
// New L1 block is not the same as the current head or a single step linear extension.
// This could either be a long L1 extension, or a reorg. Both can be handled the same way.
s
.
log
.
Warn
(
"L1 Head signal indicates an L1 re-org"
,
"old_l1_head"
,
s
.
l1Head
,
"new_l1_head_parent"
,
newL1Head
.
ParentHash
,
"new_l1_head"
,
newL1Head
)
...
...
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