<div dir="ltr"><div><i><b>tl;dr</b></i> - yes, <b>no need</b> to perform a full rebuild when adding a new <a href="https://firefox-source-docs.mozilla.org/toolkit/components/telemetry/telemetry/collection/scalars.html">Scalar</a> \o/<br><br></div><b>What's the problem?</b><br>Adding a new scalar internally generates an header file which is included by many modules throughout the codebase. This required developers to rebuild <b>all</b> these C++ modules in order to use the newly added probes, even when using artifact/build faster build workflows.<br><div><div><br></div><div><b>Who benefits from this?<br></b></div><div>Any developer using <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Artifact_builds">artifact builds</a> or building with <i>./mach build faster</i> that needs to add a new scalar probe (<i>/me winks at fx-team</i>).<br></div><div><br></div><div><b>What do I need to do?</b><br></div>This is even better: <i>nothing</i>, <i>null, nada, nihil</i>. It <b>just works</b>, in <u>local developer builds</u> for new scalar definitions (not for changing existing scalars).<br></div>Just follow the <a href="https://firefox-source-docs.mozilla.org/toolkit/components/telemetry/telemetry/collection/scalars.html#adding-a-new-probe">usual procedure</a> to add a new scalar. Of course the probes will still be available for all build configurations when performing a full build.<br><div><div><div><b><br></b></div><div><b>How does it work? Is there any downside?</b><br></div><div>When a new scalar is added, along with a new header file, the build system generates a JSON file containing the scalar definitions. These definitions are saved in the same directory as the Firefox executable and loaded at startup by builds <a href="https://searchfox.org/mozilla-central/rev/a5abf843f8fac8530aa5de6fb40e16547bb4a47a/toolkit/components/telemetry/TelemetryController.jsm#1061-1064">not defining MOZILLA_OFFICIAL</a>.<br><br></div><div>As discussed in <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1425909">bug 1425909</a>, there might be small perf implications due to loading the scalar list at startup for developer builds.<br></div><div><br><b>Reaching out</b><br><ul><li>    If you have any questions reach out to :gfritzsche, :chutten, :dexter or <a href="https://wiki.mozilla.org/Telemetry#Communication">the team</a>.</li><li>    For any specific issues, please <a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Toolkit&component=Telemetry&blocked=1425909">file a bug</a> and make it block bug 1425909.</li></ul><p><b>With <3</b>, by the Telemetry client people.<br></p></div></div></div></div>