-
Notifications
You must be signed in to change notification settings - Fork 19
log metrics around processing durations #217
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
WalkthroughThe changes introduce Prometheus histogram metrics to measure the duration of key data handling and publishing operations. Instrumentation is added throughout the orchestrator components to record, log, and observe the elapsed time for operations such as inserting, publishing, deleting, and retrieving data. No changes to control flow or public interfaces are made. Changes
Sequence Diagram(s)sequenceDiagram
participant Poller
participant Metrics
participant Storage
Poller->>Storage: InsertStagingData()
activate Poller
Note right of Poller: Start timer
Storage-->>Poller: Result
Note right of Poller: Stop timer, log duration
Poller->>Metrics: StagingInsertDuration.Observe(duration)
deactivate Poller
sequenceDiagram
participant Committer
participant Metrics
participant Storage
participant Publisher
Committer->>Storage: getBlockNumbersToCommit()
activate Committer
Note right of Committer: Start timer
Storage-->>Committer: BlockNumbers
Note right of Committer: Stop timer, log duration
Committer->>Metrics: GetBlockNumbersToCommitDuration.Observe(duration)
deactivate Committer
Committer->>Storage: getSequentialBlockDataToCommit()
activate Committer
Note right of Committer: Start timer
Storage-->>Committer: BlockData
Note right of Committer: Stop timer, log duration
Committer->>Metrics: GetStagingDataDuration.Observe(duration)
deactivate Committer
Committer->>Storage: InsertMainStorage()
activate Committer
Note right of Committer: Start timer
Storage-->>Committer: InsertResult
Note right of Committer: Stop timer, log duration
Committer->>Metrics: MainStorageInsertDuration.Observe(duration)
deactivate Committer
Committer->>Publisher: PublishBlockDataAsync()
activate Committer
Note right of Committer: Start timer
Publisher-->>Committer: PublishResult
Note right of Committer: Stop timer, log duration
Committer->>Metrics: PublishDuration.Observe(duration)
deactivate Committer
Committer->>Storage: DeleteStagingData()
activate Committer
Note right of Committer: Start timer
Storage-->>Committer: DeleteResult
Note right of Committer: Stop timer, log duration
Committer->>Metrics: StagingDeleteDuration.Observe(duration)
deactivate Committer
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code Graph Analysis (1)internal/orchestrator/poller.go (1)
🔇 Additional comments (7)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
2e4cbfa
to
e88726a
Compare
273702b
to
c17f155
Compare
18cd55e
to
ab704ec
Compare
c17f155
to
a4ab66f
Compare
a4ab66f
to
65f8943
Compare
TL;DR
Added performance metrics for database operations and Kafka publishing.
What changed?
staging_insert_duration_seconds
main_storage_insert_duration_seconds
publish_duration_seconds
staging_delete_duration_seconds
get_block_numbers_to_commit_duration_seconds
get_staging_data_duration_seconds
Committer
andPoller
components with timing measurementsgetBlockNumbersToCommit()
functiongetSequentialBlockDataToCommit()
commit()
functionhandleWorkerResults()
functionHow to test?
"metric"
fieldWhy make this change?
This change adds detailed performance metrics for database operations and Kafka publishing, which will help identify bottlenecks in the data processing pipeline. By measuring the duration of key operations, we can better understand where performance issues might be occurring and optimize accordingly. The consistent logging format with the "metric" field makes it easier to filter and analyze these performance metrics in log aggregation tools.
Summary by CodeRabbit