Skip to content

feat(pbs): count the ws bid stream under its own metrics endpoint - #499

Merged
JasonVranek merged 1 commit into
mainfrom
feat/get-header-stream-metrics
Sep 14, 2026
Merged

JasonVranek merged 1 commit into
mainfrom
feat/get-header-stream-metrics

Conversation

@JasonVranek

Copy link
Copy Markdown
Collaborator

Summary

The websocket bid stream recorded its outcome and time-to-first-bid under get_header, the same series as the HTTP fallback, so a slot served by the fallback was indistinguishable from one served by the stream. Stream attempts now count under endpoint="get_header_stream"; the fallback keeps get_header.

Four new metrics cover what a stream does that HTTP cannot:

  • relay_stream_connect_latency: websocket handshake duration, with sub-second buckets
  • relay_stream_updates: bid updates received per stream window
  • relay_stream_invalid_frames_total: frames that could not be parsed as a bid
  • relay_stream_fallback_total: handshake failures that had budget left to retry over HTTP

A handshake answered 2xx instead of 101 now reports the transport error (556) instead of the 2xx, which the stream series would otherwise read as a delivered bid. The two synthetic status codes are compile-time constants.

@JasonVranek
JasonVranek requested a review from a team September 11, 2026 03:14
@JasonVranek
JasonVranek merged commit 7b2b116 into main Sep 14, 2026
5 checks passed
@JasonVranek
JasonVranek deleted the feat/get-header-stream-metrics branch September 14, 2026 15:25
JasonVranek added a commit that referenced this pull request Oct 2, 2026
…secrets, rustls bump

Brings in #502 (submit-block relay error logging), the v0.11.0-rc2/rc3
releases with the rustls advisory bump, relay headers read from a secret
file or env var (#498), and the ws stream metrics endpoint (#499).

Conflict resolutions:
- relay.rs: kept epbs's relay_headers() helper, shared by the HTTP client
  and the stream handshake, and moved main's header resolution into it
  (HeaderSource literal/file/env, sensitive values, the secret-source log
  line). Its error messages now format the key, which epbs's did not.
- config/pbs.rs: one test module holding epbs's unknown-[pbs]-field tests
  and main's header-source tests.
- config/utils.rs: main's RELAY_URL test constant in test_env.
- Cargo.lock: main's lockfile, plus only what epbs adds.
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.

4 participants