-
Notifications
You must be signed in to change notification settings - Fork 5
NONEVM-3035: Initial LogPoller service metrics #423
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
Conversation
| // TODO Consider move chainlink core AnyMsgSentEvent and CCIPSendReqConfig to CLDF? | ||
|
|
||
| // TonSendRequest is a simplified CCIP send request structure. | ||
| // Deprecated: Use router.CCIPSend directly with SendCCIPMessage for new code. |
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.
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.
Pull request overview
This PR implements observability metrics for the TON LogPoller service, following the dual-write pattern (Prometheus + OpenTelemetry) used by the TXM service. The metrics cover core polling operations, database queries, and error tracking to enable monitoring of LogPoller health and performance.
Key Changes:
- Added comprehensive metrics instrumentation to the LogPoller service including poll duration, blocks processed, logs inserted, and error counters
- Implemented observed store wrappers (ObservedFilterStore, ObservedLogStore) that add metrics to database operations
- Updated NewService to return (Service, error) for proper metric initialization error handling
Reviewed changes
Copilot reviewed 18 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/logpoller/metrics.go | Defines Prometheus and OpenTelemetry metrics for LogPoller operations, database queries, and error tracking |
| pkg/logpoller/service.go | Integrates metrics into the service, wraps stores with observed versions, updates signature to handle initialization errors |
| pkg/logpoller/observed_filter_store.go | Wrapper for FilterStore that records query duration and result metrics |
| pkg/logpoller/observed_log_store.go | Wrapper for LogStore that records insertion and query metrics |
| pkg/txm/metrics.go | Renames internal types and methods for consistency (tonTxmMetrics → txmMetrics, GetOtelAttributes → getOtelAttributes) |
| pkg/txm/txm.go | Updates to use renamed metrics types |
| pkg/relay/chain.go | Updates NewService call to handle error return value |
| integration-tests/smoke/logpoller/log_poller_test.go | Adds error handling for NewService calls |
| integration-tests/smoke/chainaccessor/accessor_test.go | Adds error handling for NewService calls |
| integration-tests/deployment/ccip/cs_test.go | Adds error handling for NewService calls |
| deployment/ccip/cs_test_helpers.go | Removes deprecated SendTonRequest and TonSendRequest in favor of SendCCIPMessage |
| go.mod, staging-monitor/go.mod, integration-tests/go.mod, deployment/go.mod | Adds chainlink-framework/metrics dependency and updates golang.org/x/* dependencies |
| go.md | Updates dependency graph to include chainlink-framework/metrics |
| scripts/.core_version | Updates core version reference |
| cmd/chainlink-ton/lock.nix | Updates Nix lock hash |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ainlink-ton into jade/lp-metrics-base
ogtownsend
left a comment
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.
lgtm
This PR implements initial observability metrics for the TON LogPoller service, following the dual-write pattern established by TXM (Prometheus + OpenTelemetry/Beholder).
Primary Changes
Core Metrics Implementation (
pkg/logpoller/metrics.go)Database Query Metrics (Observed Stores)
Observed Store Wrappers
Breaking Changes
logpoller.NewServicenow returns (Service, error) to handle metric initialization errorsOthers