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
043cceae
Commit
043cceae
authored
Sep 06, 2023
by
Felipe Andrade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve error metrics
parent
980919b8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
eth.go
op-ufm/pkg/metrics/clients/eth.go
+5
-5
signer.go
op-ufm/pkg/metrics/clients/signer.go
+2
-2
No files found.
op-ufm/pkg/metrics/clients/eth.go
View file @
043cceae
...
@@ -22,7 +22,7 @@ func Dial(providerName string, url string) (*InstrumentedEthClient, error) {
...
@@ -22,7 +22,7 @@ func Dial(providerName string, url string) (*InstrumentedEthClient, error) {
start
:=
time
.
Now
()
start
:=
time
.
Now
()
c
,
err
:=
ethclient
.
Dial
(
url
)
c
,
err
:=
ethclient
.
Dial
(
url
)
if
err
!=
nil
{
if
err
!=
nil
{
metrics
.
RecordError
(
providerName
,
"ethclient.Dial"
)
metrics
.
RecordError
Details
(
providerName
,
"ethclient.Dial"
,
err
)
return
nil
,
err
return
nil
,
err
}
}
metrics
.
RecordRPCLatency
(
providerName
,
"ethclient"
,
"Dial"
,
time
.
Since
(
start
))
metrics
.
RecordRPCLatency
(
providerName
,
"ethclient"
,
"Dial"
,
time
.
Since
(
start
))
...
@@ -34,7 +34,7 @@ func (i *InstrumentedEthClient) TransactionByHash(ctx context.Context, hash comm
...
@@ -34,7 +34,7 @@ func (i *InstrumentedEthClient) TransactionByHash(ctx context.Context, hash comm
tx
,
isPending
,
err
:=
i
.
c
.
TransactionByHash
(
ctx
,
hash
)
tx
,
isPending
,
err
:=
i
.
c
.
TransactionByHash
(
ctx
,
hash
)
if
err
!=
nil
{
if
err
!=
nil
{
if
!
i
.
ignorableErrors
(
err
)
{
if
!
i
.
ignorableErrors
(
err
)
{
metrics
.
RecordError
(
i
.
providerName
,
"ethclient.TransactionByHash"
)
metrics
.
RecordError
Details
(
i
.
providerName
,
"ethclient.TransactionByHash"
,
err
)
}
}
return
nil
,
false
,
err
return
nil
,
false
,
err
}
}
...
@@ -46,7 +46,7 @@ func (i *InstrumentedEthClient) PendingNonceAt(ctx context.Context, address stri
...
@@ -46,7 +46,7 @@ func (i *InstrumentedEthClient) PendingNonceAt(ctx context.Context, address stri
start
:=
time
.
Now
()
start
:=
time
.
Now
()
nonce
,
err
:=
i
.
c
.
PendingNonceAt
(
ctx
,
common
.
HexToAddress
(
address
))
nonce
,
err
:=
i
.
c
.
PendingNonceAt
(
ctx
,
common
.
HexToAddress
(
address
))
if
err
!=
nil
{
if
err
!=
nil
{
metrics
.
RecordError
(
i
.
providerName
,
"ethclient.PendingNonceAt"
)
metrics
.
RecordError
Details
(
i
.
providerName
,
"ethclient.PendingNonceAt"
,
err
)
return
0
,
err
return
0
,
err
}
}
metrics
.
RecordRPCLatency
(
i
.
providerName
,
"ethclient"
,
"PendingNonceAt"
,
time
.
Since
(
start
))
metrics
.
RecordRPCLatency
(
i
.
providerName
,
"ethclient"
,
"PendingNonceAt"
,
time
.
Since
(
start
))
...
@@ -58,7 +58,7 @@ func (i *InstrumentedEthClient) TransactionReceipt(ctx context.Context, txHash c
...
@@ -58,7 +58,7 @@ func (i *InstrumentedEthClient) TransactionReceipt(ctx context.Context, txHash c
receipt
,
err
:=
i
.
c
.
TransactionReceipt
(
ctx
,
txHash
)
receipt
,
err
:=
i
.
c
.
TransactionReceipt
(
ctx
,
txHash
)
if
err
!=
nil
{
if
err
!=
nil
{
if
!
i
.
ignorableErrors
(
err
)
{
if
!
i
.
ignorableErrors
(
err
)
{
metrics
.
RecordError
(
i
.
providerName
,
"ethclient.TransactionReceipt"
)
metrics
.
RecordError
Details
(
i
.
providerName
,
"ethclient.TransactionReceipt"
,
err
)
}
}
return
nil
,
err
return
nil
,
err
}
}
...
@@ -71,7 +71,7 @@ func (i *InstrumentedEthClient) SendTransaction(ctx context.Context, tx *types.T
...
@@ -71,7 +71,7 @@ func (i *InstrumentedEthClient) SendTransaction(ctx context.Context, tx *types.T
err
:=
i
.
c
.
SendTransaction
(
ctx
,
tx
)
err
:=
i
.
c
.
SendTransaction
(
ctx
,
tx
)
if
err
!=
nil
{
if
err
!=
nil
{
if
!
i
.
ignorableErrors
(
err
)
{
if
!
i
.
ignorableErrors
(
err
)
{
metrics
.
RecordError
(
i
.
providerName
,
"ethclient.SendTransaction"
)
metrics
.
RecordError
Details
(
i
.
providerName
,
"ethclient.SendTransaction"
,
err
)
}
}
return
err
return
err
}
}
...
...
op-ufm/pkg/metrics/clients/signer.go
View file @
043cceae
...
@@ -22,7 +22,7 @@ func NewSignerClient(providerName string, logger log.Logger, endpoint string, tl
...
@@ -22,7 +22,7 @@ func NewSignerClient(providerName string, logger log.Logger, endpoint string, tl
start
:=
time
.
Now
()
start
:=
time
.
Now
()
c
,
err
:=
signer
.
NewSignerClient
(
logger
,
endpoint
,
tlsConfig
)
c
,
err
:=
signer
.
NewSignerClient
(
logger
,
endpoint
,
tlsConfig
)
if
err
!=
nil
{
if
err
!=
nil
{
metrics
.
RecordError
(
providerName
,
"signer.NewSignerClient"
)
metrics
.
RecordError
Details
(
providerName
,
"signer.NewSignerClient"
,
err
)
return
nil
,
err
return
nil
,
err
}
}
metrics
.
RecordRPCLatency
(
providerName
,
"signer"
,
"NewSignerClient"
,
time
.
Since
(
start
))
metrics
.
RecordRPCLatency
(
providerName
,
"signer"
,
"NewSignerClient"
,
time
.
Since
(
start
))
...
@@ -33,7 +33,7 @@ func (i *InstrumentedSignerClient) SignTransaction(ctx context.Context, chainId
...
@@ -33,7 +33,7 @@ func (i *InstrumentedSignerClient) SignTransaction(ctx context.Context, chainId
start
:=
time
.
Now
()
start
:=
time
.
Now
()
tx
,
err
:=
i
.
c
.
SignTransaction
(
ctx
,
chainId
,
tx
)
tx
,
err
:=
i
.
c
.
SignTransaction
(
ctx
,
chainId
,
tx
)
if
err
!=
nil
{
if
err
!=
nil
{
metrics
.
RecordError
(
i
.
providerName
,
"signer.SignTransaction"
)
metrics
.
RecordError
Details
(
i
.
providerName
,
"signer.SignTransaction"
,
err
)
return
nil
,
err
return
nil
,
err
}
}
metrics
.
RecordRPCLatency
(
i
.
providerName
,
"signer"
,
"SignTransaction"
,
time
.
Since
(
start
))
metrics
.
RecordRPCLatency
(
i
.
providerName
,
"signer"
,
"SignTransaction"
,
time
.
Since
(
start
))
...
...
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