diff --git a/.circleci/config.yml b/.circleci/config.yml index b64d2e433..ca1f70a9e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -131,8 +131,7 @@ jobs: printf '{"commit":"%s","version":"%s","source":"https://github.com/%s/%s","build":"%s"}\n' "$CIRCLE_SHA1" "$CIRCLE_TAG" "$CIRCLE_PROJECT_USERNAME" - "$CIRCLE_PROJECT_REPONAME" "$CIRCLE_BUILD_URL" - > version.json + "$CIRCLE_PROJECT_REPONAME" "$CIRCLE_BUILD_URL" > version.json - run: name: Output version.json command: cat version.json @@ -144,7 +143,7 @@ jobs: tag: $CIRCLE_TAG registry-url: gcr.io - gcp-gcr/push-image: - image: auth0-proxy + image: auth0-proxy registry-url: gcr.io tag: $CIRCLE_TAG google-project-id: GOOGLE_PROJECT_ID diff --git a/src/components/SqlModal.svelte b/src/components/SqlModal.svelte index 24756adb5..3a3e11140 100644 --- a/src/components/SqlModal.svelte +++ b/src/components/SqlModal.svelte @@ -8,6 +8,8 @@ import desktopTelemetrySql from '../stringTemplates/desktop-telemetry.tpl'; import desktopDistributionSql from '../stringTemplates/desktop-distribution.tpl'; import desktopHistogramProportionsSql from '../stringTemplates/desktop-histogram-proportions.tpl'; + import fenixGlamSql from '../stringTemplates/fenix-glam.tpl'; + import desktopGlamSql from '../stringTemplates/desktop-glam.tpl'; let sqlElement; let status; @@ -28,6 +30,40 @@ sqlElement.style.transition = ''; }, 500); } + function getGlamSql() { + const osFilter = + $store.productDimensions.os === '*' + ? 'os IS NULL' + : `os="${$store.productDimensions.os}"`; + const buildIdFilter = + $store.productDimensions.aggregationLevel === 'build_id' + ? 'app_build_id IS NOT NULL' + : 'app_build_id IS NULL'; + const processFilter = $store.productDimensions.process + ? `AND process="${$store.productDimensions.process}"` + : ''; + return _.template(desktopGlamSql)({ + metric: $store.probe.name, + channel: $store.productDimensions.channel, + osFilter, + buildIdFilter, + processFilter, + }); + } + + function getFenixGlamSql() { + const buildIdFilter = + $store.productDimensions.aggregationLevel === 'build_id' + ? 'app_build_id!="*"' + : 'app_build_id="*"'; + return _.template(fenixGlamSql)({ + app_id: $store.productDimensions.app_id, + metric: $store.probe.name.replace('.', '_'), + os: $store.productDimensions.os, + ping_type: $store.productDimensions.ping_type, + buildIdFilter, + }); + } function getDesktopSql(tpl = 'telemetry') { // TODO: Use the time horizon to date window in SQL? @@ -80,6 +116,11 @@ const tabs = []; if ($store.product === 'firefox') { + tabs.push({ + id: 2, + label: 'GLAM SQL', + sql: getGlamSql, + }); // Telemetry SQL only works on histograms. if ($store.probe.type === 'histogram') { tabs.push({ @@ -87,12 +128,13 @@ label: 'Telemetry SQL', sql: getDesktopSql, }); - tabs.push({ - id: 2, - label: 'Distribution SQL', - sql: getDesktopSql, - }); } + } else if ($store.product === 'fenix') { + tabs.push({ + id: 1, + label: 'GLAM SQL', + sql: getFenixGlamSql, + }); } @@ -202,8 +244,9 @@
Sorry, this feature is not available for Glean metrics yet.
{:else}- The following SQL query can be copy/pasted and used in the BigQuery - console to explore this data further: + The following SQL query can be copied and used in the BigQuery console + to explore further. Please note that you need internal access to our + analysis tooling to query the data.
{/if}
-
- {tab.label.includes('Distribution')
- ? tab.sql('distribution')
- : tab.sql('telemetry')}
+ {tab.sql()}
{/if}
diff --git a/src/routing/pages/probe/GleanDetails.svelte b/src/routing/pages/probe/GleanDetails.svelte
index f44e47e5f..bf62e0e1d 100644
--- a/src/routing/pages/probe/GleanDetails.svelte
+++ b/src/routing/pages/probe/GleanDetails.svelte
@@ -7,7 +7,7 @@
import { getBugURL, getBugLinkTitle } from '../../../utils/urls';
import ExternalLink from '../../../components/icons/ExternalLink.svelte';
import StatusLabel from '../../../components/StatusLabel.svelte';
- import LookerLink from '../../../components/LookerLink.svelte';
+ import SqlModal from '../../../components/SqlModal.svelte';
export let showLinks = true;
@@ -292,16 +292,11 @@
{#if showLinks}
+
-
{/if}
diff --git a/src/stringTemplates/desktop-glam.tpl b/src/stringTemplates/desktop-glam.tpl
new file mode 100644
index 000000000..31d45e050
--- /dev/null
+++ b/src/stringTemplates/desktop-glam.tpl
@@ -0,0 +1,20 @@
+-- GLAM public aggregates data for Firefox Desktop Nightly and Beta
+
+SELECT os,
+ app_version,
+ app_build_id,
+ channel,
+ metric,
+ metric_type,
+ KEY,
+ process,
+ client_agg_type,
+ agg_type,
+ total_users,
+ mozfun.glam.histogram_cast_json(aggregates) AS aggregates
+FROM `mozilla-public-data.glam_derived.client_probe_counts_firefox_desktop_nightly_v1`
+-- for `beta` channel data: mozilla-public-data.glam_derived.client_probe_counts_firefox_desktop_beta_v1
+WHERE metric="${ metric }"
+AND channel="${ channel }"
+AND ${ osFilter }
+AND ${ buildIdFilter } ${ processFilter }
\ No newline at end of file
diff --git a/src/stringTemplates/fenix-glam.tpl b/src/stringTemplates/fenix-glam.tpl
new file mode 100644
index 000000000..1c2541993
--- /dev/null
+++ b/src/stringTemplates/fenix-glam.tpl
@@ -0,0 +1,18 @@
+-- GLAM Fenix aggregates data (note that this is an internal table)
+
+SELECT ping_type,
+ os,
+ app_version,
+ app_build_id,
+ metric,
+ metric_type,
+ KEY,
+ client_agg_type,
+ agg_type,
+ total_users,
+ mozfun.glam.histogram_cast_json(aggregates) AS aggregates,
+FROM `moz-fx-data-shared-prod.glam_etl.org_mozilla_fenix_glam_${ app_id }__view_probe_counts_v1`
+WHERE metric="${ metric }"
+AND os="${ os }"
+AND ping_type="${ ping_type }"
+AND ${ buildIdFilter }
\ No newline at end of file