From aa041ffa1060e07be9a02ef6b523623f364f962a Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 16 Jun 2021 00:00:17 +0200 Subject: mod_c2s,mod_s2s: Collect stats on TLS versions and ciphers --- plugins/mod_c2s.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'plugins/mod_c2s.lua') diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua index 38a275f5..cd4b0f71 100644 --- a/plugins/mod_c2s.lua +++ b/plugins/mod_c2s.lua @@ -39,6 +39,12 @@ local stream_callbacks = { default_ns = "jabber:client" }; local listener = {}; local runner_callbacks = {}; +local m_tls_params = module:metric( + "counter", "encrypted", "", + "Encrypted connections", + {"protocol"; "cipher"} +); + module:hook("stats-update", function () -- for push backends, avoid sending out updates for each increment of -- the metric below. @@ -115,6 +121,7 @@ function stream_callbacks._streamopened(session, attr) local info = sock:info(); (session.log or log)("info", "Stream encrypted (%s with %s)", info.protocol, info.cipher); session.compressed = info.compression; + m_tls_params:with_labels(info.protocol, info.cipher):add(1) else (session.log or log)("info", "Stream encrypted"); end -- cgit v1.2.3