-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Add telemetry #27
base: main
Are you sure you want to change the base?
Conversation
internal/relayermetrics/metrics.go
Outdated
// IncActiveTargetContractsCount increases the count of active target contracts. | ||
func IncActiveTargetContractsCount() { | ||
updateMetrics(func() { | ||
metrics.ActiveTargetContracts.Inc() | ||
}) | ||
} | ||
|
||
// DecActiveTargetContractsCount decreases the count of active target contracts. | ||
func DecActiveTargetContractsCount() { | ||
updateMetrics(func() { | ||
metrics.ActiveTargetContracts.Dec() | ||
}) | ||
} | ||
|
||
// IncTxCount increments the transactions count metric for a specific tunnel. | ||
func IncTxCount(tunnelID uint64) { | ||
updateMetrics(func() { | ||
metrics.TxCount.WithLabelValues(fmt.Sprintf("%d", tunnelID)).Inc() | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- not align on plural/singular
- not align on suffix (count)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed pls check again
relayer/scheduler.go
Outdated
s.Log.Info( | ||
"New tunnel synchronized successfully", | ||
zap.String("chain_name", tunnels[i].TargetChainID), | ||
zap.Uint64("tunnel_id", tunnels[i].ID), | ||
) | ||
} | ||
|
||
s.BandLatestTunnel = len(tunnels) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
CheckingPacketInterval: checkingPacketInterval, | ||
SyncTunnelsInterval: syncTunnelsInterval, | ||
MaxCheckingPacketPenaltyDuration: maxCheckingPacketPenaltyDuration, | ||
ExponentialFactor: exponentialFactor, | ||
isErrorOnHolds: make([]bool, len(tunnelRelayers)), | ||
isSyncTunnelsAllowed: isSyncTunnelsAllowed, | ||
isErrorOnHolds: []bool{}, | ||
penaltyTaskCh: make(chan Task, penaltyTaskChSize), | ||
BandClient: bandClient, | ||
ChainProviders: chainProviders, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explicit declare latesttunnel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed too
Fixed: #XXXX
Implementation details
SyncTunnels
logicPlease ensure the following requirements are met before submitting a pull request:
CHANGELOG_UNRELEASED.md
Files changed
tab in the Github PR explorer)