TLS observability in Prometheus /metrics + CWIST v3.9 roadmap - #308
Merged
Merged
Conversation
…s, v3.9 roadmap Add TLS handshake observability ahead of the v3.9 'TLS observability & performance governance' theme (tracked in #306): - https.c owns lock-free counters for total/resumed handshakes, TLS 1.2/1.3 version buckets, cipher buckets (AES-128-GCM, AES-256-GCM, ChaCha20, other), and active established connections. Recording happens in https_wrap_established, the single choke point both the in-worker handshake path (cwist_https_accept) and the shepherd's pre-handshaked dispatch path funnel through; teardown decrements the active gauge. - The metrics registry mirrors them into the Prometheus exposition on load/render (same sync contract as cwist_http_continuation_shed_count): cwist_tls_handshakes_total, cwist_tls_handshakes_resumed_total, cwist_tls_connections_active, cwist_tls_handshakes_tls12_total, cwist_tls_handshakes_tls13_total, cwist_tls_ciphers_aes128_gcm_total, cwist_tls_ciphers_aes256_gcm_total, cwist_tls_ciphers_chacha20_total, cwist_tls_ciphers_other_total. - tests/test_https_metrics.c covers a full + a resumed TLS 1.2 handshake and a TLS 1.3 handshake, asserts counter movement, and checks the rendered /metrics exposition. ROADMAP.md gains the CWIST v3.9 Roadmap section: (a) CI TLS performance gates (in progress, gate PR pending, #306), (b) this PR's observability item (done), (c) correcting #294's premise with measured data (done via the #294 comment: the cwist_app_listen path never uses the sharded handshake shepherds -- app.c calls https_pool_submit directly and workers handshake inline; shepherds only serve the async_server.c path, so shard tuning does not affect the standard app API). Refs #306, #294
gg582
force-pushed
the
roadmap/v3.9-tls-observability
branch
from
October 4, 2026 12:22
a5ea4b7 to
6b1339c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 — ROADMAP.md: CWIST v3.9 Roadmap
Adds a CWIST v3.9 Roadmap section in the document's existing style (legend, status-at-a-glance table, entry/exit criteria), proposing the v3.9 theme: TLS observability & performance governance.
cwist_app_listenpath never uses the sharded handshake shepherds (the app.c multiport accept loop callshttps_pool_submitdirectly and pool workers handshake inline viacwist_https_accept; shepherds only serve theasync_server.ccwist_https_dispatchpath), soCWIST_HTTPS_HS_SHARDStuning does not affect the standard app API.Entry/exit criteria follow the v3.8 spirit: every item must move a measured metric (handshake throughput, resumption ratio, churn latency, or regression-detection latency) or retire a mismeasured premise.
Part 2 — TLS observability (item b)
Counters are owned lock-free in
src/net/http/https.cand mirrored into the Prometheus exposition by the metrics registry on load/render — the same sync contract ascwist_http_continuation_shed_count, so the HTTPS hot path never depends on the sys/metrics layer. Recording happens inhttps_wrap_established, the single choke point both handshake paths (in-workercwist_https_acceptand the shepherd's pre-handshaked dispatch) funnel through;https_connection_teardowndecrements the active gauge.New /metrics series:
cwist_tls_handshakes_totalcwist_tls_handshakes_resumed_totalSSL_session_reused)cwist_tls_connections_activecwist_tls_handshakes_tls12_total/cwist_tls_handshakes_tls13_totalcwist_tls_ciphers_aes128_gcm_total/cwist_tls_ciphers_aes256_gcm_total/cwist_tls_ciphers_chacha20_total/cwist_tls_ciphers_other_totalTests
New
tests/test_https_metrics.c(wired into theteststarget): performs a full and a resumed TLS 1.2 handshake plus a TLS 1.3 handshake over socketpairs, asserts every counter moves (resumption ratio, version buckets, cipher buckets, active gauge returning to baseline), and asserts the rendered Prometheus exposition contains the new series.Verified locally:
make libcwist.aclean;test_https_metrics,test_https,test_https_park,test_https_full_gc, andtest_http2all pass.Refs #306, #294