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
536340c4
Unverified
Commit
536340c4
authored
Apr 11, 2023
by
Sebastian Stammler
Committed by
GitHub
Apr 11, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5407 from ethereum-optimism/jg/metrics_cleanup
op-service/metrics: Add subsystem to event metrics
parents
b7638fb2
029566b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
metrics.go
op-batcher/metrics/metrics.go
+2
-2
event.go
op-service/metrics/event.go
+6
-2
tx_metrics.go
op-service/txmgr/metrics/tx_metrics.go
+2
-2
No files found.
op-batcher/metrics/metrics.go
View file @
536340c4
...
@@ -100,7 +100,7 @@ func NewMetrics(procName string) *Metrics {
...
@@ -100,7 +100,7 @@ func NewMetrics(procName string) *Metrics {
Help
:
"1 if the op-batcher has finished starting up"
,
Help
:
"1 if the op-batcher has finished starting up"
,
}),
}),
ChannelEvs
:
opmetrics
.
NewEventVec
(
factory
,
ns
,
"channel"
,
"Channel"
,
[]
string
{
"stage"
}),
ChannelEvs
:
opmetrics
.
NewEventVec
(
factory
,
ns
,
"
"
,
"
channel"
,
"Channel"
,
[]
string
{
"stage"
}),
PendingBlocksCount
:
*
factory
.
NewGaugeVec
(
prometheus
.
GaugeOpts
{
PendingBlocksCount
:
*
factory
.
NewGaugeVec
(
prometheus
.
GaugeOpts
{
Namespace
:
ns
,
Namespace
:
ns
,
...
@@ -145,7 +145,7 @@ func NewMetrics(procName string) *Metrics {
...
@@ -145,7 +145,7 @@ func NewMetrics(procName string) *Metrics {
Buckets
:
append
([]
float64
{
0.1
,
0.2
},
prometheus
.
LinearBuckets
(
0.3
,
0.05
,
14
)
...
),
Buckets
:
append
([]
float64
{
0.1
,
0.2
},
prometheus
.
LinearBuckets
(
0.3
,
0.05
,
14
)
...
),
}),
}),
BatcherTxEvs
:
opmetrics
.
NewEventVec
(
factory
,
ns
,
"batcher_tx"
,
"BatcherTx"
,
[]
string
{
"stage"
}),
BatcherTxEvs
:
opmetrics
.
NewEventVec
(
factory
,
ns
,
"
"
,
"
batcher_tx"
,
"BatcherTx"
,
[]
string
{
"stage"
}),
}
}
}
}
...
...
op-service/metrics/event.go
View file @
536340c4
...
@@ -16,17 +16,19 @@ func (e *Event) Record() {
...
@@ -16,17 +16,19 @@ func (e *Event) Record() {
e
.
LastTime
.
SetToCurrentTime
()
e
.
LastTime
.
SetToCurrentTime
()
}
}
func
NewEvent
(
factory
Factory
,
ns
string
,
name
string
,
displayName
string
)
Event
{
func
NewEvent
(
factory
Factory
,
ns
string
,
subsystem
string
,
name
string
,
displayName
string
)
Event
{
return
Event
{
return
Event
{
Total
:
factory
.
NewCounter
(
prometheus
.
CounterOpts
{
Total
:
factory
.
NewCounter
(
prometheus
.
CounterOpts
{
Namespace
:
ns
,
Namespace
:
ns
,
Name
:
fmt
.
Sprintf
(
"%s_total"
,
name
),
Name
:
fmt
.
Sprintf
(
"%s_total"
,
name
),
Help
:
fmt
.
Sprintf
(
"Count of %s events"
,
displayName
),
Help
:
fmt
.
Sprintf
(
"Count of %s events"
,
displayName
),
Subsystem
:
subsystem
,
}),
}),
LastTime
:
factory
.
NewGauge
(
prometheus
.
GaugeOpts
{
LastTime
:
factory
.
NewGauge
(
prometheus
.
GaugeOpts
{
Namespace
:
ns
,
Namespace
:
ns
,
Name
:
fmt
.
Sprintf
(
"last_%s_unix"
,
name
),
Name
:
fmt
.
Sprintf
(
"last_%s_unix"
,
name
),
Help
:
fmt
.
Sprintf
(
"Timestamp of last %s event"
,
displayName
),
Help
:
fmt
.
Sprintf
(
"Timestamp of last %s event"
,
displayName
),
Subsystem
:
subsystem
,
}),
}),
}
}
}
}
...
@@ -41,17 +43,19 @@ func (e *EventVec) Record(lvs ...string) {
...
@@ -41,17 +43,19 @@ func (e *EventVec) Record(lvs ...string) {
e
.
LastTime
.
WithLabelValues
(
lvs
...
)
.
SetToCurrentTime
()
e
.
LastTime
.
WithLabelValues
(
lvs
...
)
.
SetToCurrentTime
()
}
}
func
NewEventVec
(
factory
Factory
,
ns
string
,
name
string
,
displayName
string
,
labelNames
[]
string
)
EventVec
{
func
NewEventVec
(
factory
Factory
,
ns
string
,
subsystem
string
,
name
string
,
displayName
string
,
labelNames
[]
string
)
EventVec
{
return
EventVec
{
return
EventVec
{
Total
:
*
factory
.
NewCounterVec
(
prometheus
.
CounterOpts
{
Total
:
*
factory
.
NewCounterVec
(
prometheus
.
CounterOpts
{
Namespace
:
ns
,
Namespace
:
ns
,
Name
:
fmt
.
Sprintf
(
"%s_total"
,
name
),
Name
:
fmt
.
Sprintf
(
"%s_total"
,
name
),
Help
:
fmt
.
Sprintf
(
"Count of %s events"
,
displayName
),
Help
:
fmt
.
Sprintf
(
"Count of %s events"
,
displayName
),
Subsystem
:
subsystem
,
},
labelNames
),
},
labelNames
),
LastTime
:
*
factory
.
NewGaugeVec
(
prometheus
.
GaugeOpts
{
LastTime
:
*
factory
.
NewGaugeVec
(
prometheus
.
GaugeOpts
{
Namespace
:
ns
,
Namespace
:
ns
,
Name
:
fmt
.
Sprintf
(
"last_%s_unix"
,
name
),
Name
:
fmt
.
Sprintf
(
"last_%s_unix"
,
name
),
Help
:
fmt
.
Sprintf
(
"Timestamp of last %s event"
,
displayName
),
Help
:
fmt
.
Sprintf
(
"Timestamp of last %s event"
,
displayName
),
Subsystem
:
subsystem
,
},
labelNames
),
},
labelNames
),
}
}
}
}
op-service/txmgr/metrics/tx_metrics.go
View file @
536340c4
...
@@ -88,8 +88,8 @@ func MakeTxMetrics(ns string, factory metrics.Factory) TxMetrics {
...
@@ -88,8 +88,8 @@ func MakeTxMetrics(ns string, factory metrics.Factory) TxMetrics {
Help
:
"Count of publish errors. Labells are sanitized error strings"
,
Help
:
"Count of publish errors. Labells are sanitized error strings"
,
Subsystem
:
"txmgr"
,
Subsystem
:
"txmgr"
,
},
[]
string
{
"error"
}),
},
[]
string
{
"error"
}),
confirmEvent
:
metrics
.
NewEventVec
(
factory
,
ns
,
"confirm"
,
"tx confirm"
,
[]
string
{
"status"
}),
confirmEvent
:
metrics
.
NewEventVec
(
factory
,
ns
,
"
txmgr"
,
"
confirm"
,
"tx confirm"
,
[]
string
{
"status"
}),
publishEvent
:
metrics
.
NewEvent
(
factory
,
ns
,
"publish"
,
"tx publish"
),
publishEvent
:
metrics
.
NewEvent
(
factory
,
ns
,
"
txmgr"
,
"
publish"
,
"tx publish"
),
rpcError
:
factory
.
NewCounter
(
prometheus
.
CounterOpts
{
rpcError
:
factory
.
NewCounter
(
prometheus
.
CounterOpts
{
Namespace
:
ns
,
Namespace
:
ns
,
Name
:
"rpc_error_count"
,
Name
:
"rpc_error_count"
,
...
...
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