File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 55* General
66 * Stop reporting db file sizes during init phase ([ #3331 ] ( https://github.com/mozilla/glean/pull/3331 ) )
77 * Tiny performance improvement for putting tasks on the dispatcher ([ #3318 ] ( https://github.com/mozilla/glean/pull/3318 ) )
8+ * Use an explicit match for the labeled metric ping sections ([ #3335 ] ( https://github.com/mozilla/glean/pull/3335 ) )
89
910# v66.1.1 (2025-11-06)
1011
Original file line number Diff line number Diff line change @@ -32,7 +32,18 @@ fn snapshot_labeled_metrics(
3232 metric_id : & str ,
3333 metric : & Metric ,
3434) {
35- let ping_section = format ! ( "labeled_{}" , metric. ping_section( ) ) ;
35+ // Explicit match for supported labeled metrics, avoiding the formatting string
36+ let ping_section = match metric. ping_section ( ) {
37+ "boolean" => "labeled_boolean" . to_string ( ) ,
38+ "counter" => "labeled_counter" . to_string ( ) ,
39+ "timing_distribution" => "labeled_timing_distribution" . to_string ( ) ,
40+ "memory_distribution" => "labeled_memory_distribution" . to_string ( ) ,
41+ "custom_distribution" => "labeled_custom_distribution" . to_string ( ) ,
42+ "quantity" => "labeled_quantity" . to_string ( ) ,
43+ // This should never happen, we covered all cases.
44+ // Should we ever extend it this would however at least catch it and do the right thing.
45+ _ => format ! ( "labeled_{}" , metric. ping_section( ) ) ,
46+ } ;
3647 let map = snapshot. entry ( ping_section) . or_default ( ) ;
3748
3849 // Safe unwrap, the function is only called when the id does contain a '/'
You can’t perform that action at this time.
0 commit comments