Labeled test_get_value reports values for invalid labels
Categories
(Data Platform and Tools :: Glean: SDK, defect, P1)
Tracking
(Not tracked)
People
(Reporter: chutten, Assigned: chutten)
References
(Depends on 1 open bug)
Details
Attachments
(1 file)
In bug 1930572 we added testGetValue directly on labeled_* metrics so you no longer had to check each submetric's value individually (and to help power about:glean).
Unfortunately, there's a bug in LabeledMetric where any label that gets mapped to __other__ (for being not in the static list, or being more than the 16 allowed per ping) gets retained in the metric instance's label_map, each pointing to its own instance of a submetric for __other__. This leads to some surprising behaviours, e.g. for a labeled_counter metric with one static label in its definition (say, label_1), adding to labels invalid_1 the value of 1 and invalid_2 the value of 2 will result in a response from test_get_value of {invalid_1: 3, invalid_2: 3}.
This is incorrect, and should instead be {__other__: 3}.
The values in the db and reported in pings are correct, and the behaviour of asking submetrics for their values individually also remains correct.
| Assignee | ||
Updated•6 months ago
|
Comment 1•6 months ago
|
||
Updated•6 months ago
|
| Assignee | ||
Comment 2•6 months ago
|
||
chutten merged PR [mozilla/glean]: bug 2028892 - Fix Labeled's test_get_value for other labels (#3429Edit title) in efc0a59.
Description
•