Closed Bug 1673660 Opened 8 months ago Closed 6 months ago

Design and Implement C++ and JS APIs for Pings


(Toolkit :: Telemetry, task, P1)




86 Branch
Tracking Status
firefox86 --- fixed


(Reporter: chutten, Assigned: chutten)



(Whiteboard: [telemetry:fog:m6])


(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 ( 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
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.


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

Depends on D98670

Pushed by
Move FOG C++ and JS API scaffolding headers to subdir r=janerik
C++ and JS API for Glean Custom Pings r=janerik,webidl,smaug
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
You need to log in before you can comment on or make changes to this bug.