Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE OR REPLACE VIEW
`moz-fx-data-shared-prod.telemetry.doh_adoption_rate`
AS
SELECT
*
FROM
`moz-fx-data-shared-prod.telemetry_derived.doh_adoption_rate_v1`
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
friendly_name: DOH Adoption Rate
description: |-
A distinct client count of a combination of metrics to measure
the adoption of DOH (DNS over HTTPS) in Firefox.
owners:
- [email protected]
labels:
incremental: true
owner1: ascholtz
public_bigquery: true
public_json: true
review_bugs:
- '1982897'
scheduling:
dag_name: bqetl_ech_adoption_rate
bigquery:
time_partitioning:
type: day
field: 'submission_date'
require_partition_filter: true
expiration_days: null
range_partitioning: null
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
WITH unioned AS (
/* ---------- doh.evaluate_v2_heuristics ---------- */
SELECT
DATE(submission_timestamp) AS submission_date,
'doh.evaluate_v2_heuristics' AS metric,
"value" AS key,
COALESCE(STRING(event_extra.value), '') AS value,
CASE
WHEN COUNT(DISTINCT client_id) >= 5000
THEN normalized_country_code
ELSE 'OTHER'
END AS country_code,
COUNT(DISTINCT client_id) AS client_count
FROM
`moz-fx-data-shared-prod.firefox_desktop.events_stream`
WHERE
DATE(submission_timestamp) = @submission_date
AND client_id IS NOT NULL
AND client_info.app_channel = 'release'
AND event_category = 'doh'
AND event_name = 'evaluate_v2_heuristics'
GROUP BY
submission_date,
key,
value,
normalized_country_code
UNION ALL
/* ---------- doh.state_disabled ---------- */
SELECT
DATE(submission_timestamp) AS submission_date,
'doh.state_disabled' AS metric,
'' AS key,
'' AS value,
CASE
WHEN COUNT(DISTINCT client_id) >= 5000
THEN normalized_country_code
ELSE 'OTHER'
END AS country_code,
COUNT(DISTINCT client_id) AS client_count
FROM
`moz-fx-data-shared-prod.firefox_desktop.events_stream`
WHERE
DATE(submission_timestamp) = @submission_date
AND client_id IS NOT NULL
AND client_info.app_channel = 'release'
AND event_category = 'doh'
AND event_name = 'state_disabled'
GROUP BY
submission_date,
key,
value,
normalized_country_code
UNION ALL
/* ---------- doh.state_enabled ---------- */
SELECT
DATE(submission_timestamp) AS submission_date,
'doh.state_enabled' AS metric,
'' AS key,
'' AS value,
CASE
WHEN COUNT(DISTINCT client_id) >= 5000
THEN normalized_country_code
ELSE 'OTHER'
END AS country_code,
COUNT(DISTINCT client_id) AS client_count
FROM
`moz-fx-data-shared-prod.firefox_desktop.events_stream`
WHERE
DATE(submission_timestamp) = @submission_date
AND client_id IS NOT NULL
AND client_info.app_channel = 'release'
AND event_category = 'doh'
AND event_name = 'state_enabled'
GROUP BY
submission_date,
key,
value,
normalized_country_code
UNION ALL
/* ---------- doh.state_manually_disabled ---------- */
SELECT
DATE(submission_timestamp) AS submission_date,
'doh.state_manually_disabled' AS metric,
'' AS key,
'' AS value,
CASE
WHEN COUNT(DISTINCT client_id) >= 5000
THEN normalized_country_code
ELSE 'OTHER'
END AS country_code,
COUNT(DISTINCT client_id) AS client_count
FROM
`moz-fx-data-shared-prod.firefox_desktop.events_stream`
WHERE
DATE(submission_timestamp) = @submission_date
AND client_id IS NOT NULL
AND client_info.app_channel = 'release'
AND event_category = 'doh'
AND event_name = 'state_manually_disabled'
GROUP BY
submission_date,
key,
value,
normalized_country_code
UNION ALL
/* ---------- doh.state_policy_disabled ---------- */
SELECT
DATE(submission_timestamp) AS submission_date,
'doh.state_policy_disabled' AS metric,
'' AS key,
'' AS value,
CASE
WHEN COUNT(DISTINCT client_id) >= 5000
THEN normalized_country_code
ELSE 'OTHER'
END AS country_code,
COUNT(DISTINCT client_id) AS client_count
FROM
`moz-fx-data-shared-prod.firefox_desktop.events_stream`
WHERE
DATE(submission_timestamp) = @submission_date
AND client_id IS NOT NULL
AND client_info.app_channel = 'release'
AND event_category = 'doh'
AND event_name = 'state_policy_disabled'
GROUP BY
submission_date,
key,
value,
normalized_country_code
UNION ALL
/* ---------- networking.doh_heuristics_attempts ---------- */
SELECT
DATE(submission_timestamp) AS submission_date,
'networking.doh_heuristics_attempts' AS metric,
'networking.doh_heuristics_attempts' AS key,
CAST(metrics.counter.networking_doh_heuristics_attempts AS STRING) AS value,
CASE
WHEN COUNT(DISTINCT client_info.client_id) >= 5000
THEN metadata.geo.country
ELSE 'OTHER'
END AS country_code,
COUNT(DISTINCT client_info.client_id) AS client_count
FROM
`moz-fx-data-shared-prod.firefox_desktop.metrics`
WHERE
DATE(submission_timestamp) = @submission_date
AND client_info.client_id IS NOT NULL
AND client_info.app_channel = 'release'
AND metrics.counter.networking_doh_heuristics_attempts IS NOT NULL
GROUP BY
submission_date,
key,
value,
metadata.geo.country
UNION ALL
/* ---------- networking.doh_heuristics_pass_count ---------- */
SELECT
DATE(submission_timestamp) AS submission_date,
'networking.doh_heuristics_pass_count' AS metric,
'networking.doh_heuristics_attempts' AS key,
CAST(metrics.counter.networking_doh_heuristics_pass_count AS STRING) AS value,
CASE
WHEN COUNT(DISTINCT client_info.client_id) >= 5000
THEN metadata.geo.country
ELSE 'OTHER'
END AS country_code,
COUNT(DISTINCT client_info.client_id) AS client_count
FROM
`moz-fx-data-shared-prod.firefox_desktop.metrics`
WHERE
DATE(submission_timestamp) = @submission_date
AND client_info.client_id IS NOT NULL
AND client_info.app_channel = 'release'
AND metrics.counter.networking_doh_heuristics_pass_count IS NOT NULL
GROUP BY
submission_date,
key,
value,
metadata.geo.country
UNION ALL
/* ---------- networking.doh_heuristics_result ---------- */
SELECT
DATE(submission_timestamp) AS submission_date,
'networking.doh_heuristics_result' AS metric,
'networking.doh_heuristics_result' AS key,
CAST(metrics.quantity.networking_doh_heuristics_result AS STRING) AS value,
CASE
WHEN COUNT(DISTINCT client_info.client_id) >= 5000
THEN metadata.geo.country
ELSE 'OTHER'
END AS country_code,
COUNT(DISTINCT client_info.client_id) AS client_count
FROM
`moz-fx-data-shared-prod.firefox_desktop.metrics`
WHERE
DATE(submission_timestamp) = @submission_date
AND client_info.client_id IS NOT NULL
AND client_info.app_channel = 'release'
AND metrics.quantity.networking_doh_heuristics_result IS NOT NULL
GROUP BY
submission_date,
key,
value,
metadata.geo.country
UNION ALL
/* ---------- security.doh.settings.provider_choice_value ---------- */
SELECT
DATE(submission_timestamp) AS submission_date,
'security.doh.settings.provider_choice_value' AS metric,
"value" AS key,
COALESCE(STRING(event_extra.value), '') AS value,
CASE
WHEN COUNT(DISTINCT client_id) >= 5000
THEN normalized_country_code
ELSE 'OTHER'
END AS country_code,
COUNT(DISTINCT client_id) AS client_count
FROM
`moz-fx-data-shared-prod.firefox_desktop.events_stream`
WHERE
DATE(submission_timestamp) = @submission_date
AND client_id IS NOT NULL
AND client_info.app_channel = 'release'
AND event_category = 'security.doh.settings'
AND event_name = 'provider_choice_value'
GROUP BY
submission_date,
key,
value,
normalized_country_code
)
SELECT
submission_date,
metric,
key,
value,
country_code,
SUM(client_count) AS total_client_count
FROM
unioned
GROUP BY
submission_date,
metric,
key,
value,
country_code
ORDER BY
submission_date DESC,
metric,
country_code,
key,
value
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
fields:
- mode: NULLABLE
name: submission_date
type: DATE
description: The date when the telemetry data was submitted to the server.
- mode: NULLABLE
name: metric
type: STRING
description: The specific DOH (DNS-over-HTTPS) metric being measured. Can be one
of doh.evaluate_v2_heuristics (DOH heuristics evaluation), doh.state_disabled
(DOH disabled state), doh.state_enabled (DOH enabled state), doh.state_manually_disabled
(DOH manually disabled by user), doh.state_policy_disabled (DOH disabled by policy),
networking.doh_heuristics_attempts (count of heuristics attempts), networking.doh_heuristics_pass_count
(count of heuristics that passed), networking.doh_heuristics_result (result code
of heuristics evaluation), or security.doh.settings.provider_choice_value (selected
DOH provider).
- mode: NULLABLE
name: key
type: STRING
description: The key or dimension associated with the metric value. For event-based
metrics with extra fields, this represents the field name (e.g., 'value'). For
counter/quantity metrics, this is typically the metric name itself.
- mode: NULLABLE
name: value
type: STRING
description: The value associated with the metric. For event extra fields, this
contains the extra field value. For counters and quantities, this contains the
stringified numeric value. May be empty for events without extra fields.
- mode: NULLABLE
name: country_code
type: STRING
description: The ISO country code where the client is located, normalized by geolocation.
Countries with fewer than 5000 distinct clients are aggregated into 'OTHER' for
privacy reasons.
- mode: NULLABLE
name: total_client_count
type: INTEGER
description: The total count of distinct clients (by client_id) that reported this
metric, key, value, and country combination on the submission date.