Closed Bug 1883857 Opened 1 years ago Closed 6 months ago

object metric: Add JOG support

Categories

(Data Platform and Tools :: Glean: SDK, enhancement, P2)

enhancement

Tracking

(firefox137 fixed)

RESOLVED FIXED
Tracking Status
firefox137 --- fixed

People

(Reporter: janerik, Assigned: janerik)

References

Details

Attachments

(1 file, 1 obsolete file)

No description provided.
Priority: -- → P4
See Also: → 1885292
No longer blocks: 1839640
Depends on: 1839640
See Also: → 1900442
See Also: → 1911117
See Also: → 1915851
See Also: → 1936317
Assignee: nobody → jrediger
Priority: P4 → P2

Now values set on runtime object metrics are checked against the provided schema.
We use jtd - JSON type definitions - a schema definition similar to
json-schema, but much smaller in scope (RFC 8927).
We pull in the (official) jtd crate for that (it's rather small, ~1000 lines of code).

The schema is dumped into the jogfile and provided on instantiation in
the JOG code.
If that schema is defined at runtime values are checked.
That means there's one more runtime check, though that should be rather
cheap (and in code we can separate that case in the match).

This now makes test_Glean.js pass.
Not done yet: Check which other object metric tests should be
re-enabled.

This makes it possible to instantiate object metrics using JOG.
This does NOT check values against the provided schema.

Thus while this enables object metrics, they behave slightly different
than the otherwise builtin ones:
set and get works as expected from JavaScript.
However on set nothing is checked. You can set arbitrary values and
they will be recorded and returned.
Any error checking will fail.
With this change test_Glean.js fails, because it not only checks the
positive case (setting an object works), but also the negative cases
(checking that an error is recorded when invalid objects are set).

Blocks: 1947194

Comment on attachment 9465116 [details]
WIP: Bug 1883857 - Enable schema-verification for runtime object metrics r?chutten!

Revision D237547 was moved to bug 1947194. Setting attachment 9465116 [details] to obsolete.

Attachment #9465116 - Attachment is obsolete: true
Attachment #9465121 - Attachment description: WIP: Bug 1883857 - Enable object metrics in artifact builds by using a dynamic object r?chutten! → Bug 1883857 - Enable object metrics in artifact builds by using a dynamic object r?chutten!
No longer blocks: 1936319
Pushed by jrediger@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8714b406da63 Enable object metrics in artifact builds by using a dynamic object r=chutten
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Duplicate of this bug: 1775795
No longer duplicate of this bug: 1775795
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: