Mobile/Metrics/Redash
This page explains how to use Mozilla's Re:dash query and visualization system.
Overview
Re:dash is a data collaboration and visualization platform. The system can connect to a variety of datasources. Mozilla already connects several datasources (Presto, Crash-DB and Sync) to our instance. Telemetry data (UT and UI) are extracted via Spark, stored as Parquet files and exposed to Presto DB into Re:dash. If you want to query and analyze Mobile event data, make sure you are using "Presto" (the default) when making an SQL query.
Presto is a distributed SQL query engine designed to query large data sets. Browse the documentation to learn more about the SQL syntax in Presto.
Data Tables / Schemas
If you want to explore the exposed data tables in Re:dash, use this query:
show tables
If you want to examine the structure of a specific table, use this query:
describe <table-name>
Mobile telemetry data is split into two tables: android_clients_v1
and android_events_v1
.
The android_clients_v1
table holds data about common, mostly stable, information about individual Firefox installs. Each install has a unique clientid
UUID.
clientid varchar unique identifier profiledate timestamp when the installation was created, based on the profile submissiondate timestamp when the telemetry record was received by the server creationdate timestamp when the telemetry record was generated by the client appversion varchar version of Firefox osversion bigint version of Android SDK locale varchar locale code defaultsearch varchar current default search engine name device varchar device identifier string arch varchar CPU architecture channel varchar channel name (parition) submission varchar submission as a string 'YYYYMMDD' (partition)
Some of these fields can change during the lifetime of a Firefox installation. Some can't. A record is created for each telemetry ping, so it is possible to track the history of a client over time. You can see the default search engine change or the OS get updated, for a given client.
The android_events_v1
table holds event data (UI Telemetry). Each event is a record.
clientid varchar unique identifier submissiondate timestamp when the telemetry record was received by the server ts bigint relative timestamp associated with the event action varchar name of the event action method varchar name of the event method extras varchar extra contextual hint associated with the event sessions varchar sessions associated with the event (JSON array) experiments varchar a/b experiments associated with the event (JSON array) channel varchar channel name (parition) submission varchar submission as a string 'YYYYMMDD' (partition)
Useful Queries
This guide doesn't try to teach SQL, but assumes you have a basic understanding.
Looking at Events
You want to look at basic UI Telemetry over the last 7 days, like the UI Telemetry dashboard:
select submissiondate as date, channel, action, method, extras, count(*) as count from android_events_v1 where submissiondate > current_date - interval '7' day group by 1, 2, 3, 4, 5
Same, but only those events that happened during a firstrun
session:
select submissiondate as date, channel, action, method, extras, count(*) as count from android_events_v1 where submissiondate > current_date - interval '7' day and sessions like '%firstrun%' group by 1, 2, 3, 4, 5