Closed Bug 1588451 Opened 5 years ago Closed 5 years ago

Do not ignore previously seen dynamic labels before Glean inits

Categories

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

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Dexter, Assigned: mdroettboom)

References

Details

(Whiteboard: [telemetry:glean-rs:m11])

With bug 1588092, we made the glean-core implementation behave like the glean-ac undocumented behaviour to prevent startup crashes when using LabeledMetricType with dynamic labels before Glean inits.

When labeled metrics are used with dynamic labels before Glean inits, we ignore any previously persisted label. If someone where to use 16 new dynamic labels before Glean initializes, it would send 16 new labels even though we already stored 4 old ones in our database.

Priority: -- → P3
See Also: → 1588092
Whiteboard: [telemetry:glean-rs:m?]

Part of what makes this hard is the overator overloading syntax, since the look up of the label happens syncronously and the recording happens asynchronously.

One solution there would be to (backward incompatibly) change the label recording syntax from labeledCounter["label"].add(1) to labeledCounter.add("label", 1). However, this will require new wrappers for each labeled metric type.

Or, there might be a way to make label lookup part of the deferred coroutine call somehow...

Whiteboard: [telemetry:glean-rs:m?] → [telemetry:glean-rs:m11]
Assignee: nobody → mdroettboom
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.