[tls_mgm] Export active TLS connection statistics - #4283
Open
darwvin-dev wants to merge 4 commits into
Open
darwvin-dev wants to merge 4 commits into
darwvin-dev wants to merge 4 commits into
Conversation
darwvin-dev
force-pushed
the
feature/tls-mgm-statistics
branch
from
September 30, 2026 10:10
3a67b03 to
b9ee7b9
Compare
Sync with OpenSIPS master before upstream review.
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.
Summary
Export active TLS connection gauges from
tls_mgmso operators can monitor negotiated TLS versions, peer verification state and cipher families through the standard OpenSIPS statistics interface / Prometheus exporter.Statistics
tls_mgm:connectionstls_mgm:tls_v1_0_connectionstls_mgm:tls_v1_1_connectionstls_mgm:tls_v1_2_connectionstls_mgm:tls_v1_3_connectionstls_mgm:peer_verified_connectionstls_mgm:peer_unverified_connectionstls_mgm:aes_gcm_connectionstls_mgm:chacha20_connectionstls_mgm:other_cipher_connectionsImplementation
The gauges are computed from TLS metadata already cached on active
tcp_connectionobjects. A generic TCP traversal helper holds one partition lock at a time while invoking a read-only callback. This avoids counter drift and avoids adding work to the TLS handshake hot path. Exact cipher names are grouped into stable cipher families instead of creating unbounded dynamic statistic names.Validation
make include_modules="tls_mgm tls_openssl proto_tls" modules -j8— passedmake app -j8— passedgit diff --check— passedRefs #3315
Safety / validation update
The TCP traversal now ignores non-TLS/WSS connections before interpreting
shared_dataastcp_tls_info. This keeps the generic TCPshared_dataslot type-safe for other protocols while preserving TLS and WSS statistics.Revalidated after rebasing onto current
master:make include_modules="tls_mgm tls_openssl proto_tls" modules -j$(nproc)— passedmake app -j$(nproc)— passedgit diff --check— passed