Expand description
Per-request observability for calls to Suotar.
Bodies must be scrubbed with crate::credit_registration_events::scrub_suotar_body before
insert; credit_registration_ids replaces the removed identifiers for drill-down.
Structs§
- Finished
Suotar ApiCall - What only the response knows. The row itself is inserted before the request leaves.
- NewSuotar
ApiCall - PgSuotar
Call Audit - Audits every
headless_lms_utils::services::suotar::SuotarClientcall. - Suotar
ApiCall - Suotar
ApiCall Filters - The narrowings the API log applies, all of them in SQL.
- Suotar
ApiCall Page Row - A call with the page’s total attached, so a page and its count cannot come from two queries.
- Suotar
Endpoint Standing - Where one endpoint stands right now.
- Suotar
Endpoint Stats ForWindow - One endpoint’s traffic over a window, one of possibly several computed together by
get_endpoint_stats_for_windows. - Suotar
Failure Run - A run of failures the health rules key on.
Enums§
- Suotar
Endpoint - Re-exported so row readers keep one import path; the enum lives with the client that calls the
endpoints, which also stores it in the
suotar_endpointpostgres enum.
Constants§
- BODY_
SAMPLE_ MAX_ BYTES - Hard cap on a stored body, applied after sampling.
- FULL_
BODY_ ITEM_ LIMIT - Bodies are sampled in full up to this many items.
- RETENTION_
DAYS - How long call rows are kept.
- SAMPLED_
BODY_ ITEM_ COUNT - Above
FULL_BODY_ITEM_LIMIT, only this many items are kept plus a count.
Functions§
- count_
credential_ rejections_ since - Calls Suotar refused our credentials on. One is enough to stop everything registering.
- count_
unreachable_ run_ since - The unbroken run of “Suotar did not answer usefully” at the end of the window. A transport failure carries no HTTP status, which is how it is told from a refusal Suotar composed itself.
- delete_
older_ than - Hard-deletes rows past the retention window: the stored bodies must stop existing.
- finish
- get_
by_ credit_ registration_ id - Calls that mention a ledger row, for the per-item drill-down.
- get_
by_ id - get_
endpoint_ standings - Bounded to the last
RETENTION_DAYS: this table grows one row per Suotar batch call, and the Overview and the health tab each poll this every 30 seconds. - get_
endpoint_ stats_ for_ windows - One scan of the table joined against the window list, so several windows cost one pass rather
than one full pass each. A single window is just a one-element
window_secs. - get_
page - A page of the call log, newest first, without bodies. See
get_by_idfor a call’s bodies. - get_
worker_ names - The distinct
worker_namevalues in the log, so the filter offers what exists rather than a hardcoded list of phase names. - insert
- sample_
body - Shortens an already-scrubbed body to what this table keeps: whole while the batch is small, then the leading items plus a count, then nothing but the measurements.