feat: add trade route tracing - #2596
Conversation
How to use the Graphite Merge QueueAdd the label Raindex-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Warning Review limit reached
More reviews will be available in 4 minutes and 8 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
751d7e3 to
49e40c3
Compare
f76c476 to
b55444c
Compare
b55444c to
ad20ab2
Compare
49e40c3 to
2684265
Compare
2684265 to
d111acd
Compare
ad20ab2 to
caec664
Compare
caec664 to
424baed
Compare
Merge activity
|
## Chained PRs Depends on: - #2595 ## Motivation The REST trade routes use shared SDK methods for transaction lookup and filtered trade lists, but the general trade paths did not expose enough info-level timing to diagnose slow local DB/subgraph reads, merge/pagination costs, or transaction-specific fetch failures. ## Solution - Add an info-level `get_trades` span with page, filter-shape, and chain-source fields. - Promote `get_trades` local DB, subgraph, and final merge/page timing summaries to info-level logs while preserving debug details. - Add an info-level `get_trades_for_transaction` span with transaction hash and filter-shape fields. - Add local DB/subgraph timing and error logs for transaction trade lookup. - Add focused tests for the new trace metadata summarization helpers. ## Checks By submitting this for review, I'm confirming I've done the following: - [x] made this PR as small as possible - [x] unit-tested any new functionality - [ ] linked any relevant issues or PRs - [ ] included screenshots (if this involves a front-end change) Verified locally: - `nix develop -c cargo fmt --all` - `nix develop -c env COMMIT_SHA=local cargo check -p raindex_common` - `nix develop -c env COMMIT_SHA=local cargo test -p raindex_common trade_filter_trace_summary_counts_optional_filters` - `nix develop -c env COMMIT_SHA=local cargo test -p raindex_common transaction_trade_trace_summary_counts_optional_filters` - `nix develop -c env COMMIT_SHA=local cargo test -p raindex_common get_by_tx::tests::non_wasm` - `nix develop -c env COMMIT_SHA=local cargo test -p raindex_common get_all::tests`
424baed to
40d1713
Compare
## Dependent PRs - Depends on #2596 - Follows up on Gleb's review comment in #2566 to add `tracing-test` coverage. ## Motivation The tracing stack adds SDK instrumentation that the REST API relies on for order, trade, and take-order routes. This PR makes those logs test-covered so future changes do not silently remove the observability signals. ## Solution - Add `tracing-test` as a dev dependency for `raindex_common`. - Assert captured tracing output for `get_orders`, empty quote batch, remove calldata, transaction trades, generic trades, trades by order hash, and take-order approval. - Reuse existing fixtures where available and add minimal empty-result trade fixtures for the generic trade paths. ## Checks - `nix develop -c cargo fmt --all` - `nix develop -c env COMMIT_SHA=local cargo check -p raindex_common` - `nix develop -c cargo test -p raindex_common --lib`
|
@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment: S/M/L PR Classification Guidelines:This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed. Small (S)Characteristics:
Review Effort: Would have taken 5-10 minutes Examples:
Medium (M)Characteristics:
Review Effort: Would have taken 15-30 minutes Examples:
Large (L)Characteristics:
Review Effort: Would have taken 45+ minutes Examples:
Additional Factors to ConsiderWhen deciding between sizes, also consider:
Notes:
|

Chained PRs
Depends on:
Motivation
The REST trade routes use shared SDK methods for transaction lookup and filtered trade lists, but the general trade paths did not expose enough info-level timing to diagnose slow local DB/subgraph reads, merge/pagination costs, or transaction-specific fetch failures.
Solution
get_tradesspan with page, filter-shape, and chain-source fields.get_tradeslocal DB, subgraph, and final merge/page timing summaries to info-level logs while preserving debug details.get_trades_for_transactionspan with transaction hash and filter-shape fields.Checks
By submitting this for review, I'm confirming I've done the following:
Verified locally:
nix develop -c cargo fmt --allnix develop -c env COMMIT_SHA=local cargo check -p raindex_commonnix develop -c env COMMIT_SHA=local cargo test -p raindex_common trade_filter_trace_summary_counts_optional_filtersnix develop -c env COMMIT_SHA=local cargo test -p raindex_common transaction_trade_trace_summary_counts_optional_filtersnix develop -c env COMMIT_SHA=local cargo test -p raindex_common get_by_tx::tests::non_wasmnix develop -c env COMMIT_SHA=local cargo test -p raindex_common get_all::tests