Skip to content
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

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

[Feature] Add telemetry #27

wants to merge 27 commits into from

Conversation

tanut32039
Copy link
Contributor

@tanut32039 tanut32039 commented Jan 17, 2025

Fixed: #XXXX

Implementation details

Please ensure the following requirements are met before submitting a pull request:

  • The pull request is targeted against the correct target branch
  • The pull request is linked to an issue with appropriate discussion and an accepted design OR is linked to a spec that describes the work.
  • The pull request includes a description of the implementation/work done in detail.
  • The pull request includes any and all appropriate unit/integration tests
  • You have added a relevant changelog entry to CHANGELOG_UNRELEASED.md
  • You have re-reviewed the files affected by the pull request (e.g. using the Files changed tab in the Github PR explorer)

dockerfile Outdated Show resolved Hide resolved
relayer/scheduler.go Outdated Show resolved Hide resolved
relayer/scheduler.go Outdated Show resolved Hide resolved
internal/relayermetrics/metrics.go Show resolved Hide resolved
@tanut32039 tanut32039 requested a review from RogerKSI February 4, 2025 04:01
cmd/start.go Outdated Show resolved Hide resolved
relayer/app.go Outdated Show resolved Hide resolved
internal/relayermetrics/metrics.go Outdated Show resolved Hide resolved
internal/relayermetrics/metrics.go Outdated Show resolved Hide resolved
relayer/app.go Outdated Show resolved Hide resolved
relayer/tunnel_relayer.go Outdated Show resolved Hide resolved
relayer/tunnel_relayer.go Outdated Show resolved Hide resolved
relayer/tunnel_relayer.go Outdated Show resolved Hide resolved
relayer/scheduler.go Outdated Show resolved Hide resolved
internal/relayermetrics/metrics.go Outdated Show resolved Hide resolved
@tanut32039 tanut32039 requested a review from nkitlabs February 6, 2025 07:45
relayer/scheduler.go Outdated Show resolved Hide resolved
relayer/scheduler.go Outdated Show resolved Hide resolved
internal/relayermetrics/metrics.go Outdated Show resolved Hide resolved
internal/relayermetrics/metrics.go Outdated Show resolved Hide resolved
internal/relayermetrics/metrics.go Outdated Show resolved Hide resolved
internal/relayermetrics/metrics.go Outdated Show resolved Hide resolved
internal/relayermetrics/metrics.go Outdated Show resolved Hide resolved
relayer/scheduler.go Outdated Show resolved Hide resolved
relayer/app.go Outdated Show resolved Hide resolved
relayer/scheduler.go Show resolved Hide resolved
Comment on lines 77 to 96
// 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()
})
}

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed pls check again

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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private

Copy link
Contributor Author

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,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explicit declare latesttunnel

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed too

@tanut32039 tanut32039 requested a review from RogerKSI February 19, 2025 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants