Skip to content

Commit 5a973ae

Browse files
committed
refactor(metrics): remove legacy _drops_total compatibility mirrors (security-union#690)
PR security-union#670 renamed gauges from videocall_*_drops_total to videocall_*_drops but kept the old names as deprecated mirrors. Enough time has passed for dashboards to migrate. Remove DATAGRAM_DROPS_TOTAL and WEBSOCKET_DROPS_TOTAL gauge registrations, their dual-emit sites, dual-cleanup code, and the `or rate(...drops_total...)` fallback from the Grafana dashboard JSON.
1 parent a15ef01 commit 5a973ae

3 files changed

Lines changed: 4 additions & 30 deletions

File tree

actix-api/src/bin/metrics_server.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use sec_api::metrics::{
5252
CLIENT_ACTIVE_SERVER_RTT_MS, CLIENT_INFO, CLIENT_LONGTASK_DURATION_MS,
5353
CLIENT_MEMORY_TOTAL_BYTES, CLIENT_MEMORY_USED_BYTES, CLIENT_PACKETS_RECEIVED_PER_SEC,
5454
CLIENT_PACKETS_SENT_PER_SEC, CLIENT_RENDER_FPS, CLIENT_SEND_QUEUE_BYTES, CLIENT_TAB_THROTTLED,
55-
CLIENT_TAB_VISIBLE, DATAGRAM_DROPS, DATAGRAM_DROPS_TOTAL, DECODER_ERRORS_TOTAL,
55+
CLIENT_TAB_VISIBLE, DATAGRAM_DROPS, DECODER_ERRORS_TOTAL,
5656
ENCODER_BITRATE_RATIO, ENCODER_FPS_RATIO, ENCODER_OUTPUT_FPS, ENCODER_P75_PEER_FPS,
5757
ENCODER_TARGET_BITRATE_KBPS, ENCODER_WORST_PEER_FPS, HEALTH_REPORTS_TOTAL,
5858
KEYFRAME_REQUESTS_SENT_TOTAL, MEETING_PARTICIPANTS, NETEQ_ACCELERATE_OPS_PER_SEC,
@@ -61,7 +61,7 @@ use sec_api::metrics::{
6161
PEER_AUDIO_ENABLED, PEER_CAN_LISTEN, PEER_CAN_SEE, PEER_CONNECTIONS_TOTAL, PEER_VIDEO_ENABLED,
6262
SCREEN_SHARING_ACTIVE, SCREEN_VIDEO_BITRATE_KBPS, SCREEN_VIDEO_FPS, SELF_AUDIO_ENABLED,
6363
SELF_VIDEO_ENABLED, TIER_TRANSITIONS_TOTAL, VIDEO_BITRATE_KBPS, VIDEO_FPS,
64-
VIDEO_FRAMES_DROPPED, VIDEO_QUALITY_SCORE, WEBSOCKET_DROPS, WEBSOCKET_DROPS_TOTAL,
64+
VIDEO_FRAMES_DROPPED, VIDEO_QUALITY_SCORE, WEBSOCKET_DROPS,
6565
};
6666

6767
async fn metrics_handler(
@@ -188,9 +188,7 @@ fn remove_session_metrics(session_info: &SessionInfo) {
188188
let _ = ADAPTIVE_VIDEO_TIER.remove_label_values(&reporter_labels);
189189
let _ = ADAPTIVE_AUDIO_TIER.remove_label_values(&reporter_labels);
190190
let _ = DATAGRAM_DROPS.remove_label_values(&reporter_labels);
191-
let _ = DATAGRAM_DROPS_TOTAL.remove_label_values(&reporter_labels);
192191
let _ = WEBSOCKET_DROPS.remove_label_values(&reporter_labels);
193-
let _ = WEBSOCKET_DROPS_TOTAL.remove_label_values(&reporter_labels);
194192
let _ = KEYFRAME_REQUESTS_SENT_TOTAL.remove_label_values(&reporter_labels);
195193
let _ = ENCODER_FPS_RATIO.remove_label_values(&reporter_labels);
196194
let _ = ENCODER_WORST_PEER_FPS.remove_label_values(&reporter_labels);
@@ -604,17 +602,11 @@ fn process_health_packet_to_metrics_pb(
604602
DATAGRAM_DROPS
605603
.with_label_values(&reporter_labels)
606604
.set(drops as f64);
607-
DATAGRAM_DROPS_TOTAL
608-
.with_label_values(&reporter_labels)
609-
.set(drops as f64);
610605
}
611606
if let Some(drops) = health_packet.websocket_drops_total {
612607
WEBSOCKET_DROPS
613608
.with_label_values(&reporter_labels)
614609
.set(drops as f64);
615-
WEBSOCKET_DROPS_TOTAL
616-
.with_label_values(&reporter_labels)
617-
.set(drops as f64);
618610
}
619611
if let Some(kf_reqs) = health_packet.keyframe_requests_sent_total {
620612
KEYFRAME_REQUESTS_SENT_TOTAL

actix-api/src/metrics.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -387,15 +387,6 @@ lazy_static! {
387387
)
388388
.expect("Failed to create datagram_drops metric");
389389

390-
/// Deprecated compatibility mirror for dashboards still querying the old
391-
/// counter-shaped gauge name.
392-
pub static ref DATAGRAM_DROPS_TOTAL: GaugeVec = register_gauge_vec!(
393-
"videocall_datagram_drops_total",
394-
"Cumulative datagrams dropped due to locked writable stream",
395-
&["meeting_id", "session_id", "peer_id", "display_name"]
396-
)
397-
.expect("Failed to create datagram_drops_total metric");
398-
399390
/// Cumulative WebSocket packet drops as of the latest client health snapshot.
400391
pub static ref WEBSOCKET_DROPS: GaugeVec = register_gauge_vec!(
401392
"videocall_websocket_drops",
@@ -404,15 +395,6 @@ lazy_static! {
404395
)
405396
.expect("Failed to create websocket_drops metric");
406397

407-
/// Deprecated compatibility mirror for dashboards still querying the old
408-
/// counter-shaped gauge name.
409-
pub static ref WEBSOCKET_DROPS_TOTAL: GaugeVec = register_gauge_vec!(
410-
"videocall_websocket_drops_total",
411-
"Cumulative WebSocket packets dropped due to send buffer backpressure",
412-
&["meeting_id", "session_id", "peer_id", "display_name"]
413-
)
414-
.expect("Failed to create websocket_drops_total metric");
415-
416398
/// Cumulative keyframe requests sent (PLI)
417399
pub static ref KEYFRAME_REQUESTS_SENT_TOTAL: GaugeVec = register_gauge_vec!(
418400
"videocall_keyframe_requests_sent_total",

helm/grafana/dashboards/meeting-investigation.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,12 +1504,12 @@
15041504
},
15051505
"targets": [
15061506
{
1507-
"expr": "rate(videocall_datagram_drops{meeting_id=~\"$meeting\"}[$__rate_interval]) or rate(videocall_datagram_drops_total{meeting_id=~\"$meeting\"}[$__rate_interval])",
1507+
"expr": "rate(videocall_datagram_drops{meeting_id=~\"$meeting\"}[$__rate_interval])",
15081508
"legendFormat": "WT {{display_name}}",
15091509
"refId": ""
15101510
},
15111511
{
1512-
"expr": "rate(videocall_websocket_drops{meeting_id=~\"$meeting\"}[$__rate_interval]) or rate(videocall_websocket_drops_total{meeting_id=~\"$meeting\"}[$__rate_interval])",
1512+
"expr": "rate(videocall_websocket_drops{meeting_id=~\"$meeting\"}[$__rate_interval])",
15131513
"legendFormat": "WS {{display_name}}",
15141514
"refId": ""
15151515
}

0 commit comments

Comments
 (0)