Skip to content

Add cancellation-safe quote request metrics#4609

Draft
AryanGodara wants to merge 1 commit into
mainfrom
aryan/quote-request-metrics
Draft

Add cancellation-safe quote request metrics#4609
AryanGodara wants to merge 1 commit into
mainfrom
aryan/quote-request-metrics

Conversation

@AryanGodara

Copy link
Copy Markdown
Member

Description

Adds cancellation-safe metrics for the /quote endpoint: every request is counted at handler entry (so client-cancelled/dropped requests are included), plus a separate counter for downstream requests to the price-estimation layer — giving an incoming-vs-downstream view

Changes

Adds three counters

  • gp_v2_api_quote_requests_started{price_quality}: incremented at handler entry, before the first .await, so cancelled requests are still counted.
  • gp_v2_api_quote_requests_finished{price_quality,result} result success|error|cancelled, via a Drop guard defaulting to cancelled. Invariant: started == sum(finished).
  • gp_v2_api_quote_downstream_requests{kind} kind trade|native, incremented per fan-out in OrderQuoter::compute_quote_data for the incoming-vs-downstream ratio.

@AryanGodara AryanGodara self-assigned this Jul 7, 2026
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.

1 participant