Object metric: document (and possibly improve) behavior of null values
Categories
(Data Platform and Tools :: Glean: SDK, enhancement, P2)
Tracking
(Not tracked)
People
(Reporter: afranchuk, Assigned: janerik)
Details
Attachments
(2 files)
Since null values aren't valid (as far as I know, though maybe they can be set as arrays or objects?), it'd be great if Glean allowed setString JSON objects to contain nulls and automatically ignore/remove them where appropriate (e.g. for an object where a key maps to null, the key will be removed). Right now, nulls seem to result in the metric not being set.
Whether the behavior changes or not, it'd be helpful to document it explicitly.
| Assignee | ||
Comment 1•1 year ago
|
||
I actually think this is already the case for the Rust API; and for the JavaScript API too.
Are you running into trouble from Kotlin?
I'll take a look, at a test and better docs.
| Assignee | ||
Updated•1 year ago
|
| Reporter | ||
Comment 2•1 year ago
|
||
I'm having trouble in Rust.
| Assignee | ||
Comment 3•1 year ago
|
||
Oh. Ok, I take a look.
| Assignee | ||
Comment 4•1 year ago
|
||
Can you show what code is going wrong? Because I currently cannot reproduce that.
| Assignee | ||
Updated•1 year ago
|
| Reporter | ||
Comment 5•1 year ago
|
||
https://phabricator.services.mozilla.com/D218215
If you comment out the call to remove_nulls in this patch, a test will fail with the metric being unset (run mach rusttests).
| Assignee | ||
Comment 6•1 year ago
|
||
I can reproduce that now, I'll look into it.
| Assignee | ||
Comment 7•1 year ago
|
||
Comment 8•1 year ago
|
||
| Assignee | ||
Comment 9•1 year ago
|
||
| Assignee | ||
Comment 10•1 year ago
|
||
badboy merged PR [mozilla/glean]: Bug 1910809 - Rust: Test an object metric with null values (#2921) in a18cadc.
Description
•