{"id":165,"date":"2019-11-29T18:37:42","date_gmt":"2019-11-29T18:37:42","guid":{"rendered":"https:\/\/blog.mozilla.org\/data\/?p=165"},"modified":"2020-05-11T15:19:45","modified_gmt":"2020-05-11T15:19:45","slug":"this-week-in-glean-differences","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/data\/2019\/11\/29\/this-week-in-glean-differences\/","title":{"rendered":"This Week in Glean: Differences"},"content":{"rendered":"<p><em>(\u201cThis Week in Glean\u201d is a series of blog posts that the Glean Team at Mozilla is using to try to communicate better about our work. They could be release notes, documentation, hopes, dreams, or whatever: so long as it is inspired by Glean. You can find an <a href=\"https:\/\/mozilla.github.io\/glean\/book\/appendix\/twig.html\">index of all TWiG posts online<\/a>.)<\/em><\/p>\n<p>Currently my team is responsible for the Telemetry framework inside Firefox on Desktop and also <a href=\"https:\/\/github.com\/mozilla\/glean\">the Glean SDK<\/a>, targeting our mobile products. We&#8217;re working on bringing the Glean experience to Firefox on Desktop, but in the meantime <a href=\"https:\/\/firefox-source-docs.mozilla.org\/toolkit\/components\/telemetry\/index.html\">Telemetry<\/a> is what we have, need to support and sometimes implement new features on.<\/p>\n<p>One of these features is a new ping (or, better, a change in a ping), that we now want to support across all our products. I&#8217;m speaking of the <a href=\"https:\/\/firefox-source-docs.mozilla.org\/toolkit\/components\/telemetry\/data\/deletion-request-ping.html\"><code>deletion-request<\/code> ping<\/a> here. When a user opts out of Telemetry we take this as a signal to also delete associated data from our pipeline.<\/p>\n<p>Implementation in Firefox Desktop was merely renaming <a href=\"https:\/\/firefox-source-docs.mozilla.org\/toolkit\/components\/telemetry\/obsolete\/optout-ping.html\">an existing ping<\/a> that is triggered when the user disables &#8220;Data Collection and Use&#8221; (<code>about:preferences<\/code> -&gt; Privacy &amp; Security). It contains no additional data. Implementation in Glean was not much harder either. Glean already supports <a href=\"https:\/\/mozilla.github.io\/glean\/book\/user\/pings\/custom.html\">custom pings<\/a>: Pings that can be defined and send by the application using Glean. Glean&#8217;s internal pings follow the same pattern, they are just pre-defined. The biggest difference?<\/p>\n<p>It&#8217;s called <code>deletion_request<\/code> ping instead.<\/p>\n<p>On ingestion data from a ping is decoded from its JSON form and put into tables on BigQuery (in our documentation you can find <a href=\"https:\/\/docs.telemetry.mozilla.org\/concepts\/pipeline\/gcp_data_pipeline.html#an-overview-of-mozillas-data-pipeline\">an overview of the data pipeline<\/a> if you are interested). BigQuery table names can only contain alphanumeric characters and underscores (see <a href=\"https:\/\/cloud.google.com\/bigquery\/docs\/tables#table_naming\">&#8220;Table naming&#8221;<\/a> in the BigQuery documentation). We avoid any translation in the pipeline by just enforcing this directly on ping names.<\/p>\n<p>Glean also enforces the payload schema of pings. Glean itself controls portion of the data, including a sequence number, date field and a bit of metadata about the application its running in (see <a href=\"https:\/\/mozilla.github.io\/glean\/book\/user\/pings\/index.html#ping-sections\">the ping sections<\/a>). The rest of the payload consists of <a href=\"https:\/\/mozilla.github.io\/glean\/book\/user\/metrics\/index.html\">metrics<\/a> as defined by users of Glean. While implementing the new ping I stumbled upon another small detail of Glean: Pings won&#8217;t be sent out if they would not contain any metrics. And our new ping, by design, should not contain any metrics!<\/p>\n<p>We don&#8217;t want to change this for other pings, so I had to introduce a new flag now: <code>sendIfEmpty<\/code> (<a href=\"https:\/\/github.com\/mozilla\/glean_parser\/pull\/139\">PR #139<\/a>).<\/p>\n<p>That way we can allow the <code>deletion_request<\/code> ping to be sent without any metrics in there, only containing the basic information.<\/p>\n<p>The implementation of the new ping is now done and currently waiting for data review (<a href=\"https:\/\/github.com\/mozilla\/glean\/pull\/526\">PR #526<\/a>). I hope to land this early next week.<\/p>\n<p>(( This is a syndicated copy of <a href=\"https:\/\/fnordig.de\/2019\/11\/29\/this-week-in-glean\/\">the original post<\/a>. ))<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(\u201cThis Week in Glean\u201d is a series of blog posts that the Glean Team at Mozilla is using to try to communicate better about our work. They could be release &hellip; <a class=\"go\" href=\"https:\/\/blog.mozilla.org\/data\/2019\/11\/29\/this-week-in-glean-differences\/\">Read more<\/a><\/p>\n","protected":false},"author":1756,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[315988,448297],"tags":[],"coauthors":[],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/data\/wp-json\/wp\/v2\/posts\/165"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/data\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/data\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/data\/wp-json\/wp\/v2\/users\/1756"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/data\/wp-json\/wp\/v2\/comments?post=165"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/data\/wp-json\/wp\/v2\/posts\/165\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/data\/wp-json\/wp\/v2\/media?parent=165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/data\/wp-json\/wp\/v2\/categories?post=165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/data\/wp-json\/wp\/v2\/tags?post=165"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blog.mozilla.org\/data\/wp-json\/wp\/v2\/coauthors?post=165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}