Skip to content

starknet_transaction_prover: Prometheus /metrics endpoint with build_info#14167

Open
avi-starkware wants to merge 1 commit into
avi/prover-v3/panic-shutdownfrom
avi/prover-v3/metrics
Open

starknet_transaction_prover: Prometheus /metrics endpoint with build_info#14167
avi-starkware wants to merge 1 commit into
avi/prover-v3/panic-shutdownfrom
avi/prover-v3/metrics

Conversation

@avi-starkware

Copy link
Copy Markdown
Collaborator

Adds MetricsLayer that short-circuits GET /metrics with a Prometheus
text-format scrape, and an install_exporter helper that registers the
global recorder and emits prover_build_info with version + git_sha
labels. Wired alongside HealthLayer so the scrape path bypasses the
JSON-RPC parser.

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 changes: new scrape endpoint and a counter on existing capacity rejection; no change to proving or auth logic.

Overview
Adds Prometheus observability to the transaction prover: startup calls install_exporter to register the global recorder and emit prover_build_info (version + git_sha) before the server binds, so early scrapes still see build identity.

A new MetricsLayer handles GET /metrics in the HTTP stack (alongside health), returning Prometheus text without hitting the JSON-RPC parser on both plain HTTP and TLS paths. prove_transaction now increments prover_concurrency_rejected_total when the concurrency semaphore rejects a request (counter is pre-registered at 0 at startup).

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

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9c4a5a0. Configure here.

Comment thread crates/starknet_transaction_prover/src/server/metrics.rs
@avi-starkware avi-starkware force-pushed the avi/prover-v3/metrics branch from 9c4a5a0 to 5eb413f Compare May 24, 2026 16:48
@avi-starkware avi-starkware force-pushed the avi/prover-v3/panic-shutdown branch from 63d34df to c31ce65 Compare May 26, 2026 08:43
@avi-starkware avi-starkware force-pushed the avi/prover-v3/metrics branch 2 times, most recently from 186e4cf to 9959caa Compare May 26, 2026 12:16
@avi-starkware avi-starkware force-pushed the avi/prover-v3/panic-shutdown branch 2 times, most recently from 72a08b0 to 17dbfd9 Compare May 26, 2026 12:17
@avi-starkware avi-starkware force-pushed the avi/prover-v3/metrics branch from 9959caa to 1733122 Compare May 26, 2026 12:17
@avi-starkware avi-starkware force-pushed the avi/prover-v3/panic-shutdown branch from 17dbfd9 to 9845d29 Compare May 26, 2026 12:58
@avi-starkware avi-starkware force-pushed the avi/prover-v3/metrics branch from 1733122 to 4403df0 Compare May 26, 2026 12:58
@avi-starkware avi-starkware force-pushed the avi/prover-v3/panic-shutdown branch from 9845d29 to 4d23115 Compare May 26, 2026 16:14
@avi-starkware avi-starkware force-pushed the avi/prover-v3/metrics branch 2 times, most recently from 3e19b68 to f196a34 Compare May 26, 2026 16:47
@avi-starkware avi-starkware force-pushed the avi/prover-v3/panic-shutdown branch from 4d23115 to c3950e4 Compare May 26, 2026 16:59
@avi-starkware avi-starkware force-pushed the avi/prover-v3/metrics branch from f196a34 to 294f3f8 Compare May 26, 2026 16:59
@avi-starkware avi-starkware force-pushed the avi/prover-v3/panic-shutdown branch from c3950e4 to fe2dccc Compare May 27, 2026 10:01
@avi-starkware avi-starkware force-pushed the avi/prover-v3/metrics branch 2 times, most recently from 7c12cba to aa40e3d Compare May 27, 2026 10:35
@avi-starkware avi-starkware force-pushed the avi/prover-v3/panic-shutdown branch 2 times, most recently from 5d57ce5 to d99ffe1 Compare May 27, 2026 12:55
@avi-starkware avi-starkware force-pushed the avi/prover-v3/metrics branch 2 times, most recently from 3790635 to 6834e33 Compare May 27, 2026 13:11
@avi-starkware avi-starkware force-pushed the avi/prover-v3/panic-shutdown branch from d99ffe1 to 264bf5b Compare May 27, 2026 13:11
@avi-starkware avi-starkware force-pushed the avi/prover-v3/metrics branch from 6834e33 to c055b5f Compare May 27, 2026 14:04
@avi-starkware avi-starkware force-pushed the avi/prover-v3/panic-shutdown branch from 264bf5b to 282284b Compare May 27, 2026 14:04
@avi-starkware avi-starkware force-pushed the avi/prover-v3/metrics branch from c055b5f to b9b156a Compare May 27, 2026 14:20
@avi-starkware avi-starkware force-pushed the avi/prover-v3/panic-shutdown branch from 073a1ff to 8d4c874 Compare May 31, 2026 10:23
@avi-starkware avi-starkware force-pushed the avi/prover-v3/metrics branch from b9b156a to 69e6de4 Compare May 31, 2026 10:23
@avi-starkware avi-starkware force-pushed the avi/prover-v3/panic-shutdown branch from 8d4c874 to bdf34cf Compare June 1, 2026 08:17
@avi-starkware avi-starkware force-pushed the avi/prover-v3/metrics branch 2 times, most recently from 8abd666 to bca1e04 Compare June 1, 2026 11:18
@avi-starkware avi-starkware force-pushed the avi/prover-v3/panic-shutdown branch from bdf34cf to 15340a8 Compare June 1, 2026 11:18
…info

Adds `MetricsLayer` that short-circuits `GET /metrics` with a Prometheus
text-format scrape, and an `install_exporter` helper that registers the
global recorder and emits `prover_build_info` with version + git_sha
labels. Wired alongside `HealthLayer` so the scrape path bypasses the
JSON-RPC parser.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@avi-starkware avi-starkware force-pushed the avi/prover-v3/panic-shutdown branch from 15340a8 to d7e132f Compare June 7, 2026 10:11
@avi-starkware avi-starkware force-pushed the avi/prover-v3/metrics branch from bca1e04 to bc665d6 Compare June 7, 2026 10:11
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