Closed Bug 1685406 Opened 3 months ago Closed 17 days ago

Implement the proposed Glean Interface for Firefox Telemetry (GIFFT)


(Toolkit :: Telemetry, enhancement, P1)




89 Branch
Tracking Status
firefox89 --- fixed


(Reporter: chutten, Assigned: chutten)


(Blocks 1 open bug)


(Whiteboard: [telemetry:fog:m?])


(7 files)

Following the design proposed in bug 1681812 (proposal doc), implement the mirroring of Glean Metric Type API calls in C++ and JS to Telemetry APIs when the metrics have telemetry mirrors specified in their definitions in metrics.yaml.

Work will include:

  • Augmenting glean_parser to accept telemetry_mirror string fields and verify the mirrored metrics have a lifetime of ping
  • Adding the new Glean Metric ID -> Histogram/Scalar/Event ID maps/switchblocks to the glean_parser C++ code generator
  • Augmenting each Glean Metric Type in the MLA (toolkit/components/glean/bindings/private/) to check if there's a mirror and, if so, call the appropriate Telemetry APIs
    • Be careful about processes here.
  • Tests
  • Documentation in-tree, including a conversion guide
    • Be sure to highlight that this is a temporary measure to get us through Migration
Assignee: nobody → chutten
Points: --- → 3
Priority: P3 → P1
Whiteboard: [telemetry:fog:m?]
Summary: Implement the proposed Glean API Frontend for Firefox Telemetry → Implement the proposed Glean Interface for Firefox Telemetry (GIFFT)

Additional requirement: Due to bug 1670261 stalled due to new gecko+nimbus+a-s+glean megazord proposal, this should also provide an ability to instrument using Glean APIs in C++/JS without Glean actually being present in the build. (Glean No-op or GNop)

As a result C++ and JS APIs and generated metrics will be unconditionally present in Gecko.

Depends on: 1695197

Depends on D109624

I tried my best to keep this self-contained so it'll be easy to remove.


  • For all three Telemetry probe types we must generate new headers
    that map from metric id to mirrored probe id.
  • For events, note that we must generate a second file because of
    our strongly-typed enum class extra event keys in the C++ FOG
    Event API.
  • This is intended to work in situations where there is no Glean.
    This meant rewriting a few APIs to return monotonically-increasing
    ids instead of 0 in the event there is no SDK around to generate them.

Depends on D109627

Pushed by
Fix incorrect comment. r=janerik
Move EventExtraEntry to Telemetry.h r=janerik
Correct some now-incorrect FOG IPC docs on testing r=janerik
Clarify how new Glean metric types should architect themselves in FOG's MLA r=janerik
Glean Interface For Firefox Telemetry (GIFFT) r=janerik
Add regression suite for GIFFT codegen. r=janerik
Blocks: 1701769
Regressions: 1701949
You need to log in before you can comment on or make changes to this bug.