Software /
code /
prosody
Diff
plugins/mod_c2s.lua @ 11608:b2610460d9ab
mod_c2s,mod_s2s: Collect stats on TLS versions and ciphers
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 16 Jun 2021 00:00:17 +0200 |
parent | 11560:3bbb1af92514 |
child | 11614:1ac8976f09a9 |
line wrap: on
line diff
--- a/plugins/mod_c2s.lua Sat Jun 12 18:06:37 2021 +0200 +++ b/plugins/mod_c2s.lua Wed Jun 16 00:00:17 2021 +0200 @@ -39,6 +39,12 @@ 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 @@ 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