Closed Bug 1673660 Opened 4 years ago Closed 3 years ago

Design and Implement C++ and JS APIs for Pings

Categories

(Toolkit :: Telemetry, task, P1)

task

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: chutten, Assigned: chutten)

References

Details

(Whiteboard: [telemetry:fog:m6])

Attachments

(2 files)

Loosely following the docs, implement the C++ and JS APIs for Pings.

This will mark the first time that C++ can submit pings in Firefox without spawning a pingsender process!

Note that this also requires writing the code generation templates for Pings in JS and C++. There is no design covering this, so we'll also need at least a micro-proposal design for them, too.

Summary: Implement C++ and JS APIs for Pings → Design and Implement C++ and JS APIs for Pings

Don't forget to update the test landing in bug 1675114 (test_fog_custom_ping.py) when the JS API lands. Actually, nevermind. bug 1675114 can't be tested that way because the ping object is never instantiated which means it's never registered which means it can't be sent.

Current straw design:

  • JS will add a new global GleanPings which will have the registered pings available via named getter a la categories on the global Glean
  • C++ will use the namespace mozilla::glean_pings with the Ping objects available therein.
  • The ping objects in C++ will hold ids for MLA FFI. We'll need to generate string tables and PingId tables like we do for metrics.
  • We need to add pings_test_outputs for cpp and js to our pytests
Assignee: nobody → chutten
Status: NEW → ASSIGNED
Priority: P3 → P1

Headers we want our consumers to use remain in mozilla/glean,
but scaffolding now lives in mozilla/glean/bindings.

This will allow me to have a binding for the GleanPings global in GleanPings.h
AS WELL AS a GleanPings.h which is the C++ consumer API for custom pings.

Covers adding the new JS global GleanPings for JS, the new structs for C++ at
mozilla::glean_pings, ping-id and string-table-index codegen, the usual
boilerplate for JS and C++ stuff, and tests.

Unresolved:

  • What happens if we call this on a non-parent process?
    (This isn't a supported mode of operation)

Depends on D98670

Pushed by chutten@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/551fd43769ca
Move FOG C++ and JS API scaffolding headers to subdir r=janerik
https://hg.mozilla.org/integration/autoland/rev/f6c62f38a583
C++ and JS API for Glean Custom Pings r=janerik,webidl,smaug
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: