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
4a5e1832
Unverified
Commit
4a5e1832
authored
Sep 21, 2022
by
smartcontracts
Committed by
GitHub
Sep 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(fd): use better metric labels (#3488)
Improves and simplifies metrics by using better metric labels.
parent
c427f0c0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
23 deletions
+43
-23
funny-mirrors-return.md
.changeset/funny-mirrors-return.md
+5
-0
service.ts
packages/fault-detector/src/service.ts
+38
-23
No files found.
.changeset/funny-mirrors-return.md
0 → 100644
View file @
4a5e1832
---
'
@eth-optimism/fault-detector'
:
minor
---
Updates metrics to use better labels.
packages/fault-detector/src/service.ts
View file @
4a5e1832
...
@@ -22,11 +22,9 @@ type Options = {
...
@@ -22,11 +22,9 @@ type Options = {
}
}
type
Metrics
=
{
type
Metrics
=
{
highestCheckedBatchIndex
:
Gauge
highestBatchIndex
:
Gauge
highestKnownBatchIndex
:
Gauge
isCurrentlyMismatched
:
Gauge
isCurrentlyMismatched
:
Gauge
l1NodeConnectionFailures
:
Gauge
nodeConnectionFailures
:
Gauge
l2NodeConnectionFailures
:
Gauge
}
}
type
State
=
{
type
State
=
{
...
@@ -64,25 +62,19 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
...
@@ -64,25 +62,19 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
},
},
},
},
metricsSpec
:
{
metricsSpec
:
{
highest
Checked
BatchIndex
:
{
highestBatchIndex
:
{
type
:
Gauge
,
type
:
Gauge
,
desc
:
'
Highest good batch index
'
,
desc
:
'
Highest batch indices (checked and known)
'
,
},
labels
:
[
'
type
'
],
highestKnownBatchIndex
:
{
type
:
Gauge
,
desc
:
'
Highest known batch index
'
,
},
},
isCurrentlyMismatched
:
{
isCurrentlyMismatched
:
{
type
:
Gauge
,
type
:
Gauge
,
desc
:
'
0 if state is ok, 1 if state is mismatched
'
,
desc
:
'
0 if state is ok, 1 if state is mismatched
'
,
},
},
l1N
odeConnectionFailures
:
{
n
odeConnectionFailures
:
{
type
:
Gauge
,
type
:
Gauge
,
desc
:
'
Number of times L1 node connection has failed
'
,
desc
:
'
Number of times node connection has failed
'
,
},
labels
:
[
'
layer
'
,
'
section
'
],
l2NodeConnectionFailures
:
{
type
:
Gauge
,
desc
:
'
Number of times L2 node connection has failed
'
,
},
},
},
},
})
})
...
@@ -148,7 +140,10 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
...
@@ -148,7 +140,10 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
node
:
'
l1
'
,
node
:
'
l1
'
,
section
:
'
getTotalBatches
'
,
section
:
'
getTotalBatches
'
,
})
})
this
.
metrics
.
l1NodeConnectionFailures
.
inc
()
this
.
metrics
.
nodeConnectionFailures
.
inc
({
layer
:
'
l1
'
,
section
:
'
getTotalBatches
'
,
})
await
sleep
(
15000
)
await
sleep
(
15000
)
return
return
}
}
...
@@ -157,7 +152,12 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
...
@@ -157,7 +152,12 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
await
sleep
(
15000
)
await
sleep
(
15000
)
return
return
}
else
{
}
else
{
this
.
metrics
.
highestKnownBatchIndex
.
set
(
latestBatchIndex
)
this
.
metrics
.
highestBatchIndex
.
set
(
{
type
:
'
known
'
,
},
latestBatchIndex
)
}
}
this
.
logger
.
info
(
`checking batch`
,
{
this
.
logger
.
info
(
`checking batch`
,
{
...
@@ -177,7 +177,10 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
...
@@ -177,7 +177,10 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
node
:
'
l1
'
,
node
:
'
l1
'
,
section
:
'
findEventForStateBatch
'
,
section
:
'
findEventForStateBatch
'
,
})
})
this
.
metrics
.
l1NodeConnectionFailures
.
inc
()
this
.
metrics
.
nodeConnectionFailures
.
inc
({
layer
:
'
l1
'
,
section
:
'
findEventForStateBatch
'
,
})
await
sleep
(
15000
)
await
sleep
(
15000
)
return
return
}
}
...
@@ -191,7 +194,10 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
...
@@ -191,7 +194,10 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
node
:
'
l1
'
,
node
:
'
l1
'
,
section
:
'
getTransaction
'
,
section
:
'
getTransaction
'
,
})
})
this
.
metrics
.
l1NodeConnectionFailures
.
inc
()
this
.
metrics
.
nodeConnectionFailures
.
inc
({
layer
:
'
l1
'
,
section
:
'
getTransaction
'
,
})
await
sleep
(
15000
)
await
sleep
(
15000
)
return
return
}
}
...
@@ -214,7 +220,10 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
...
@@ -214,7 +220,10 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
node
:
'
l2
'
,
node
:
'
l2
'
,
section
:
'
getBlockNumber
'
,
section
:
'
getBlockNumber
'
,
})
})
this
.
metrics
.
l2NodeConnectionFailures
.
inc
()
this
.
metrics
.
nodeConnectionFailures
.
inc
({
layer
:
'
l2
'
,
section
:
'
getBlockNumber
'
,
})
await
sleep
(
15000
)
await
sleep
(
15000
)
return
return
}
}
...
@@ -246,7 +255,10 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
...
@@ -246,7 +255,10 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
node
:
'
l2
'
,
node
:
'
l2
'
,
section
:
'
getBlockRange
'
,
section
:
'
getBlockRange
'
,
})
})
this
.
metrics
.
l2NodeConnectionFailures
.
inc
()
this
.
metrics
.
nodeConnectionFailures
.
inc
({
layer
:
'
l2
'
,
section
:
'
getBlockRange
'
,
})
await
sleep
(
15000
)
await
sleep
(
15000
)
return
return
}
}
...
@@ -276,7 +288,10 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
...
@@ -276,7 +288,10 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
}
}
this
.
state
.
highestCheckedBatchIndex
++
this
.
state
.
highestCheckedBatchIndex
++
this
.
metrics
.
highestCheckedBatchIndex
.
set
(
this
.
metrics
.
highestBatchIndex
.
set
(
{
type
:
'
checked
'
,
},
this
.
state
.
highestCheckedBatchIndex
this
.
state
.
highestCheckedBatchIndex
)
)
...
...
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