Skip to content

starknet_transaction_prover: HTTP request count + latency + in-flight metrics#14169

Open
avi-starkware wants to merge 1 commit into
avi/prover-v3/job-metricsfrom
avi/prover-v3/http-metrics
Open

starknet_transaction_prover: HTTP request count + latency + in-flight metrics#14169
avi-starkware wants to merge 1 commit into
avi/prover-v3/job-metricsfrom
avi/prover-v3/http-metrics

Conversation

@avi-starkware

Copy link
Copy Markdown
Collaborator

Adds HttpMetricsLayer placed between the monitoring endpoints and the
rest of the stack so probes/scrapes don't distort the request-latency
distribution. Records request count by bounded method/status labels,
end-to-end latency, and in-flight gauge. Also adds a shared test recorder
helper that installs the global Prometheus recorder once across the
test binary.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

@cursor

cursor Bot commented May 24, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Observability-only middleware with bounded label cardinality; no changes to proving, auth, or request handling semantics beyond metric recording.

Overview
Adds HttpMetricsLayer to the shared prover_http_middleware! stack so the prover exposes HTTP-level Prometheus series: request totals (bounded method + status labels), end-to-end latency by method, and an in-flight gauge with an RAII guard so panics/cancellation don’t leak the gauge.

The layer sits below HealthLayer / MetricsLayer so /health and /metrics short-circuits never hit it and don’t skew latency. preregister_http_metrics() runs from install_exporter so series exist before the first real request (histogram is described but not pre-recorded, to avoid phantom zero observations).

Unit tests assert counter/histogram deltas and that in-flight returns to zero after sequential requests.

Reviewed by Cursor Bugbot for commit 9a9f080. Bugbot is set up for automated code reviews on this repo. Configure here.

avi-starkware commented May 24, 2026

Copy link
Copy Markdown
Collaborator Author

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@avi-starkware avi-starkware force-pushed the avi/prover-v3/job-metrics branch from 7d179cb to a0e7299 Compare May 24, 2026 16:48
@avi-starkware avi-starkware force-pushed the avi/prover-v3/http-metrics branch 2 times, most recently from 6c02d2b to 2af08ad Compare May 26, 2026 08:43
@avi-starkware avi-starkware force-pushed the avi/prover-v3/job-metrics branch 2 times, most recently from 00671e6 to 68683f0 Compare May 26, 2026 12:16
@avi-starkware avi-starkware force-pushed the avi/prover-v3/http-metrics branch 2 times, most recently from 47068b1 to eea5655 Compare May 26, 2026 12:17
@avi-starkware avi-starkware force-pushed the avi/prover-v3/job-metrics branch from 00f7551 to b51be4a Compare May 26, 2026 12:58
@avi-starkware avi-starkware force-pushed the avi/prover-v3/http-metrics branch from eea5655 to df42f2f Compare May 26, 2026 12:58
@avi-starkware avi-starkware force-pushed the avi/prover-v3/http-metrics branch from df42f2f to 83d004c Compare May 26, 2026 16:14
@avi-starkware avi-starkware force-pushed the avi/prover-v3/job-metrics branch from b51be4a to 396774b Compare May 26, 2026 16:14
@avi-starkware avi-starkware force-pushed the avi/prover-v3/http-metrics branch from 83d004c to 9122417 Compare May 26, 2026 16:47
@avi-starkware avi-starkware force-pushed the avi/prover-v3/job-metrics branch 2 times, most recently from 6f17bb1 to fb01d37 Compare May 26, 2026 16:59
@avi-starkware avi-starkware force-pushed the avi/prover-v3/http-metrics branch from 9122417 to 23731d6 Compare May 26, 2026 16:59
@avi-starkware avi-starkware force-pushed the avi/prover-v3/job-metrics branch from fb01d37 to f1b98e4 Compare May 27, 2026 10:01
@avi-starkware avi-starkware force-pushed the avi/prover-v3/http-metrics branch from 23731d6 to 145ff10 Compare May 27, 2026 10:01
@avi-starkware avi-starkware force-pushed the avi/prover-v3/job-metrics branch from f1b98e4 to 9898133 Compare May 27, 2026 10:35
@avi-starkware avi-starkware force-pushed the avi/prover-v3/http-metrics branch 2 times, most recently from 130f7f6 to 7fa5a6d Compare May 27, 2026 12:55
@avi-starkware avi-starkware force-pushed the avi/prover-v3/job-metrics branch from 9898133 to 6974938 Compare May 27, 2026 12:56
@avi-starkware avi-starkware force-pushed the avi/prover-v3/http-metrics branch from 7fa5a6d to fe8282d Compare May 27, 2026 13:11
@avi-starkware avi-starkware force-pushed the avi/prover-v3/job-metrics branch 2 times, most recently from d0b3654 to d84bd92 Compare May 27, 2026 14:04
@avi-starkware avi-starkware force-pushed the avi/prover-v3/http-metrics branch from fe8282d to d9c346a Compare May 27, 2026 14:04
@avi-starkware avi-starkware force-pushed the avi/prover-v3/http-metrics branch from d9c346a to d3505a7 Compare May 27, 2026 14:20
@avi-starkware avi-starkware force-pushed the avi/prover-v3/job-metrics branch 2 times, most recently from b2da23d to ac34a57 Compare May 31, 2026 10:23
@avi-starkware avi-starkware force-pushed the avi/prover-v3/http-metrics branch 3 times, most recently from f13a24c to 2eaa611 Compare June 1, 2026 11:18
@avi-starkware avi-starkware force-pushed the avi/prover-v3/job-metrics branch from 97f32a2 to 15f1abf Compare June 1, 2026 11:18
@avi-starkware avi-starkware force-pushed the avi/prover-v3/job-metrics branch from 15f1abf to 931d783 Compare June 7, 2026 10:11
@avi-starkware avi-starkware force-pushed the avi/prover-v3/http-metrics branch from 2eaa611 to 1da46b5 Compare June 7, 2026 10:11
@avi-starkware avi-starkware force-pushed the avi/prover-v3/job-metrics branch from 931d783 to a61deca Compare July 1, 2026 17:32
@avi-starkware avi-starkware force-pushed the avi/prover-v3/http-metrics branch from 1da46b5 to 561765f Compare July 1, 2026 17:32
@avi-starkware avi-starkware force-pushed the avi/prover-v3/job-metrics branch from a61deca to fb3d592 Compare July 2, 2026 09:53
@avi-starkware avi-starkware force-pushed the avi/prover-v3/http-metrics branch from 561765f to c41e5cc Compare July 2, 2026 09:53
… metrics

Adds `HttpMetricsLayer` placed between the monitoring endpoints and the
rest of the stack so probes/scrapes don't distort the request-latency
distribution. Records request count by bounded method/status labels,
end-to-end latency, and in-flight gauge. Also adds a shared test recorder
helper that installs the global Prometheus recorder once across the
test binary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@avi-starkware avi-starkware force-pushed the avi/prover-v3/http-metrics branch from c41e5cc to 9a9f080 Compare July 2, 2026 11:53
@avi-starkware avi-starkware force-pushed the avi/prover-v3/job-metrics branch from fb3d592 to cddf9b5 Compare July 2, 2026 11:53
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.

2 participants