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
16ecca2f
Commit
16ecca2f
authored
Nov 26, 2023
by
Hamdi Allam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
preserve existing metric names for proven/finalized withdrawals
parent
037ec87d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
metrics.go
indexer/processors/bridge/metrics.go
+19
-9
No files found.
indexer/processors/bridge/metrics.go
View file @
16ecca2f
...
...
@@ -59,8 +59,10 @@ type bridgeMetrics struct {
intervalDuration
*
prometheus
.
HistogramVec
intervalFailures
*
prometheus
.
CounterVec
txDeposits
prometheus
.
Counter
txWithdrawals
*
prometheus
.
CounterVec
txDeposits
prometheus
.
Counter
txWithdrawals
prometheus
.
Counter
provenWithdrawals
prometheus
.
Counter
finalizedWithdrawals
prometheus
.
Counter
txMintedETH
prometheus
.
Counter
txWithdrawnETH
prometheus
.
Counter
...
...
@@ -117,18 +119,26 @@ func NewMetrics(registry *prometheus.Registry) Metricer {
Name
:
"tx_minted_eth"
,
Help
:
"amount of eth bridged from l1"
,
}),
txWithdrawals
:
factory
.
NewCounter
Vec
(
prometheus
.
CounterOpts
{
txWithdrawals
:
factory
.
NewCounter
(
prometheus
.
CounterOpts
{
Namespace
:
MetricsNamespace
,
Name
:
"tx_withdrawals"
,
Help
:
"number of processed transactions withdrawals (initiated|proven|finalized)"
,
},
[]
string
{
"stage"
,
Help
:
"number of initiated transaction withdrawals from l2"
,
}),
txWithdrawnETH
:
factory
.
NewCounter
(
prometheus
.
CounterOpts
{
Namespace
:
MetricsNamespace
,
Name
:
"tx_withdrawn_eth"
,
Help
:
"amount of eth withdrawn from l2"
,
}),
provenWithdrawals
:
factory
.
NewCounter
(
prometheus
.
CounterOpts
{
Namespace
:
MetricsNamespace
,
Name
:
"proven_withdrawals"
,
Help
:
"number of proven tx withdrawals on l1"
,
}),
finalizedWithdrawals
:
factory
.
NewCounter
(
prometheus
.
CounterOpts
{
Namespace
:
MetricsNamespace
,
Name
:
"finalized_withdrawals"
,
Help
:
"number of finalized tx withdrawals on l1"
,
}),
sentMessages
:
factory
.
NewCounterVec
(
prometheus
.
CounterOpts
{
Namespace
:
MetricsNamespace
,
Name
:
"sent_messages"
,
...
...
@@ -201,11 +211,11 @@ func (m *bridgeMetrics) RecordL1TransactionDeposits(size int, mintedETH float64)
}
func
(
m
*
bridgeMetrics
)
RecordL1ProvenWithdrawals
(
size
int
)
{
m
.
txWithdrawals
.
WithLabelValues
(
"stage"
,
"proven"
)
.
Add
(
float64
(
size
))
m
.
provenWithdrawals
.
Add
(
float64
(
size
))
}
func
(
m
*
bridgeMetrics
)
RecordL1FinalizedWithdrawals
(
size
int
)
{
m
.
txWithdrawals
.
WithLabelValues
(
"stage"
,
"finalized"
)
.
Add
(
float64
(
size
))
m
.
finalizedWithdrawals
.
Add
(
float64
(
size
))
}
func
(
m
*
bridgeMetrics
)
RecordL1CrossDomainSentMessages
(
size
int
)
{
...
...
@@ -258,7 +268,7 @@ func (m *bridgeMetrics) RecordL2LatestFinalizedHeight(height *big.Int) {
}
func
(
m
*
bridgeMetrics
)
RecordL2TransactionWithdrawals
(
size
int
,
withdrawnETH
float64
)
{
m
.
txWithdrawals
.
WithLabelValues
(
"stage"
,
"initiated"
)
.
Add
(
float64
(
size
))
m
.
txWithdrawals
.
Add
(
float64
(
size
))
m
.
txWithdrawnETH
.
Add
(
withdrawnETH
)
}
...
...
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