Closed Bug 2028892 Opened 6 months ago Closed 6 months ago

Labeled test_get_value reports values for invalid labels

Categories

(Data Platform and Tools :: Glean: SDK, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

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: chutten → nobody
Severity: S3 → --
Status: ASSIGNED → NEW
Priority: P1 → --
Assignee: nobody → chutten
Priority: -- → P1
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Depends on: 2040417
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: