diff --git a/media/mtransport/transportlayerdtls.cpp b/media/mtransport/transportlayerdtls.cpp index dcc280653db9..fc522b262a5c 100644 --- a/media/mtransport/transportlayerdtls.cpp +++ b/media/mtransport/transportlayerdtls.cpp @@ -1528,7 +1528,7 @@ TransportLayerDtls::RecordCipherTelemetry() { nsresult rv = GetCipherSuite(&cipher); if (NS_FAILED(rv)) { - MOZ_MTLOG(ML_ERROR, "Failed to get cipher suite"); + MOZ_MTLOG(ML_ERROR, "Failed to get DTLS cipher suite"); return; } @@ -1580,6 +1580,34 @@ TransportLayerDtls::RecordCipherTelemetry() { } Telemetry::Accumulate(Telemetry::WEBRTC_DTLS_CIPHER, t_cipher); + + rv = GetSrtpCipher(&cipher); + + if (NS_FAILED(rv)) { + MOZ_MTLOG(ML_ERROR, "Failed to get SRTP cipher suite"); + return; + } + + mozilla::Telemetry::LABELS_WEBRTC_SRTP_CIPHER label = + mozilla::Telemetry::LABELS_WEBRTC_SRTP_CIPHER::Unknown; + + switch (cipher) { + case kDtlsSrtpAes128CmHmacSha1_80: + label = Telemetry::LABELS_WEBRTC_SRTP_CIPHER::Aes128CmHmacSha1_80; + break; + case kDtlsSrtpAes128CmHmacSha1_32: + label = Telemetry::LABELS_WEBRTC_SRTP_CIPHER::Aes128CmHmacSha1_32; + break; + case kDtlsSrtpAeadAes128Gcm: + label = Telemetry::LABELS_WEBRTC_SRTP_CIPHER::AeadAes128Gcm; + break; + case kDtlsSrtpAeadAes256Gcm: + label = Telemetry::LABELS_WEBRTC_SRTP_CIPHER::AeadAes256Gcm; + break; + } + + Telemetry::AccumulateCategorical(label); + } } // close namespace diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 31df70b438b0..b9db07daae96 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -8673,6 +8673,15 @@ "n_values": 14, "description": "The DTLS cipher (as integer) negotiated for a RTCPeerConnection. See TransportLayerDtls::RecordCipherTelemetry for the meaning of the values" }, + "WEBRTC_SRTP_CIPHER": { + "record_in_processes": ["content"], + "alert_emails": ["webrtc-dtls-telemetry-alerts@mozilla.com", "nohlmeier@mozilla.com"], + "bug_numbers": [1491511], + "expires_in_version": "67", + "kind": "categorical", + "labels": ["Unknown", "Aes128CmHmacSha1_80", "Aes128CmHmacSha1_32", "AeadAes128Gcm", "AeadAes256Gcm"], + "description": "The SRTP cipher (as integer) negotiated for a RTCPeerConnection. See TransportLayerDtls::RecordCipherTelemetry for the meaning of the values" + }, "WEBRTC_ICE_FINAL_CONNECTION_STATE": { "record_in_processes": ["main", "content"], "alert_emails": ["webrtc-ice-telemetry-alerts@mozilla.com, nohlmeier@mozilla.com"],