-- Query generated by: sql/telemetry_derived/clients_daily_histogram_aggregates_v1.sql.py --agg-type keyed_histograms
CREATE TEMP FUNCTION udf_aggregate_json_sum(histograms ARRAY<STRING>) AS (
  ARRAY(
    SELECT AS STRUCT
      FORMAT('%d', values_entry.key) AS key,
      SUM(values_entry.value) AS value
    FROM
      UNNEST(histograms) AS histogram,
      UNNEST(mozfun.hist.extract(histogram).values) AS values_entry
    WHERE
      histogram IS NOT NULL
    GROUP BY
      values_entry.key
    ORDER BY
      values_entry.key
  )
);

WITH valid_build_ids AS (
  SELECT DISTINCT
    (build.build.id) AS build_id
  FROM
    `moz-fx-data-shared-prod.telemetry.buildhub2`
),
filtered AS (
  SELECT
    *,
    SPLIT(application.version, '.')[OFFSET(0)] AS app_version,
    DATE(submission_timestamp) AS submission_date,
    normalized_os AS os,
    application.build_id AS app_build_id,
    normalized_channel AS channel
  FROM
    `moz-fx-data-shared-prod.telemetry_stable.main_v5`
  INNER JOIN
    valid_build_ids
    ON (application.build_id = build_id)
  WHERE
    DATE(submission_timestamp) = @submission_date
    AND normalized_channel IN ("release", "beta", "nightly")
    AND client_id IS NOT NULL
),
sampled_data AS (
  SELECT
    *
  FROM
    filtered
  WHERE
    channel IN ("nightly", "beta")
    OR (channel = "release" AND os != "Windows")
    OR (channel = "release" AND os = "Windows" AND MOD(sample_id, @sample_size) = 0)
),
grouped_metrics AS (
  SELECT
    DATE(submission_timestamp) AS submission_date,
    sample_id,
    client_id,
    normalized_os AS os,
    SPLIT(application.version, '.')[OFFSET(0)] AS app_version,
    application.build_id AS app_build_id,
    normalized_channel AS channel,
    ARRAY<
      STRUCT<
        name STRING,
        metric_type STRING,
        process STRING,
        value ARRAY<STRUCT<key STRING, value STRING>>,
        bucket_range STRUCT<first_bucket INT64, last_bucket INT64, num_buckets INT64>
      >
    >[
      (
        'addon_content_policy_shim_blocking_loaded_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.addon_content_policy_shim_blocking_loaded_ms,
        (1, 60000, 20)
      ),
      (
        'addon_content_policy_shim_blocking_loaded_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.addon_content_policy_shim_blocking_loaded_ms,
        (1, 60000, 20)
      ),
      (
        'addon_content_policy_shim_blocking_loading_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.addon_content_policy_shim_blocking_loading_ms,
        (1, 60000, 20)
      ),
      (
        'addon_content_policy_shim_blocking_loading_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.addon_content_policy_shim_blocking_loading_ms,
        (1, 60000, 20)
      ),
      (
        'addon_forbidden_cpow_usage',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.addon_forbidden_cpow_usage,
        (1, 2, 3)
      ),
      (
        'addon_forbidden_cpow_usage',
        'histogram-count',
        'parent',
        payload.keyed_histograms.addon_forbidden_cpow_usage,
        (1, 2, 3)
      ),
      (
        'addon_shim_usage',
        'histogram-enumerated',
        'content',
        payload.processes.content.keyed_histograms.addon_shim_usage,
        (1, 15, 16)
      ),
      (
        'addon_shim_usage',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.addon_shim_usage,
        (1, 15, 16)
      ),
      (
        'application_reputation_server_verdict_2',
        'histogram-categorical',
        'content',
        payload.processes.content.keyed_histograms.application_reputation_server_verdict_2,
        (1, 50, 51)
      ),
      (
        'application_reputation_server_verdict_2',
        'histogram-categorical',
        'parent',
        payload.keyed_histograms.application_reputation_server_verdict_2,
        (1, 50, 51)
      ),
      (
        'blocked_on_plugin_instance_destroy_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.blocked_on_plugin_instance_destroy_ms,
        (1, 10000, 20)
      ),
      (
        'blocked_on_plugin_instance_destroy_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.blocked_on_plugin_instance_destroy_ms,
        (1, 10000, 20)
      ),
      (
        'blocked_on_plugin_instance_init_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.blocked_on_plugin_instance_init_ms,
        (1, 10000, 20)
      ),
      (
        'blocked_on_plugin_instance_init_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.blocked_on_plugin_instance_init_ms,
        (1, 10000, 20)
      ),
      (
        'blocked_on_plugin_module_init_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.blocked_on_plugin_module_init_ms,
        (1, 10000, 20)
      ),
      (
        'blocked_on_plugin_module_init_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.blocked_on_plugin_module_init_ms,
        (1, 10000, 20)
      ),
      (
        'blocked_on_plugin_stream_init_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.blocked_on_plugin_stream_init_ms,
        (1, 10000, 20)
      ),
      (
        'blocked_on_plugin_stream_init_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.blocked_on_plugin_stream_init_ms,
        (1, 10000, 20)
      ),
      (
        'blocked_on_pluginasyncsurrogate_waitforinit_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.blocked_on_pluginasyncsurrogate_waitforinit_ms,
        (1, 10000, 20)
      ),
      (
        'blocked_on_pluginasyncsurrogate_waitforinit_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.blocked_on_pluginasyncsurrogate_waitforinit_ms,
        (1, 10000, 20)
      ),
      (
        'canvas_webgl_accl_failure_id',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.canvas_webgl_accl_failure_id,
        (1, 2, 3)
      ),
      (
        'canvas_webgl_accl_failure_id',
        'histogram-count',
        'parent',
        payload.keyed_histograms.canvas_webgl_accl_failure_id,
        (1, 2, 3)
      ),
      (
        'canvas_webgl_failure_id',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.canvas_webgl_failure_id,
        (1, 2, 3)
      ),
      (
        'canvas_webgl_failure_id',
        'histogram-count',
        'parent',
        payload.keyed_histograms.canvas_webgl_failure_id,
        (1, 2, 3)
      ),
      (
        'content_js_background_tick_delay_events_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.content_js_background_tick_delay_events_ms,
        (1, 100, 10)
      ),
      (
        'content_js_background_tick_delay_events_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.content_js_background_tick_delay_events_ms,
        (1, 100, 10)
      ),
      (
        'content_js_foreground_tick_delay_events_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.content_js_foreground_tick_delay_events_ms,
        (1, 100, 10)
      ),
      (
        'content_js_foreground_tick_delay_events_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.content_js_foreground_tick_delay_events_ms,
        (1, 100, 10)
      ),
      (
        'content_large_paint_phase_weight',
        'histogram-linear',
        'content',
        payload.processes.content.keyed_histograms.content_large_paint_phase_weight,
        (1, 100, 10)
      ),
      (
        'content_large_paint_phase_weight',
        'histogram-linear',
        'parent',
        payload.keyed_histograms.content_large_paint_phase_weight,
        (1, 100, 10)
      ),
      (
        'content_signature_verification_errors',
        'histogram-categorical',
        'content',
        payload.processes.content.keyed_histograms.content_signature_verification_errors,
        (1, 50, 51)
      ),
      (
        'content_signature_verification_errors',
        'histogram-categorical',
        'parent',
        payload.keyed_histograms.content_signature_verification_errors,
        (1, 50, 51)
      ),
      (
        'content_small_paint_phase_weight',
        'histogram-linear',
        'content',
        payload.processes.content.keyed_histograms.content_small_paint_phase_weight,
        (1, 100, 10)
      ),
      (
        'content_small_paint_phase_weight',
        'histogram-linear',
        'parent',
        payload.keyed_histograms.content_small_paint_phase_weight,
        (1, 100, 10)
      ),
      (
        'd3d11_compositing_failure_id',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.d3d11_compositing_failure_id,
        (1, 2, 3)
      ),
      (
        'd3d11_compositing_failure_id',
        'histogram-count',
        'parent',
        payload.keyed_histograms.d3d11_compositing_failure_id,
        (1, 2, 3)
      ),
      (
        'd3d9_compositing_failure_id',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.d3d9_compositing_failure_id,
        (1, 2, 3)
      ),
      (
        'd3d9_compositing_failure_id',
        'histogram-count',
        'parent',
        payload.keyed_histograms.d3d9_compositing_failure_id,
        (1, 2, 3)
      ),
      (
        'decoder_doctor_infobar_stats',
        'histogram-enumerated',
        'content',
        payload.processes.content.keyed_histograms.decoder_doctor_infobar_stats,
        (1, 8, 9)
      ),
      (
        'decoder_doctor_infobar_stats',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.decoder_doctor_infobar_stats,
        (1, 8, 9)
      ),
      (
        'devtools_cold_toolbox_open_delay_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.devtools_cold_toolbox_open_delay_ms,
        (1, 60000, 100)
      ),
      (
        'devtools_gcli_commands_keyed',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.devtools_gcli_commands_keyed,
        (1, 2, 3)
      ),
      (
        'devtools_gcli_commands_keyed',
        'histogram-count',
        'parent',
        payload.keyed_histograms.devtools_gcli_commands_keyed,
        (1, 2, 3)
      ),
      (
        'devtools_javascript_error_displayed',
        'histogram-boolean',
        'content',
        payload.processes.content.keyed_histograms.devtools_javascript_error_displayed,
        (1, 2, 3)
      ),
      (
        'devtools_javascript_error_displayed',
        'histogram-boolean',
        'parent',
        payload.keyed_histograms.devtools_javascript_error_displayed,
        (1, 2, 3)
      ),
      (
        'devtools_memory_breakdown_census_count',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.devtools_memory_breakdown_census_count,
        (1, 2, 3)
      ),
      (
        'devtools_memory_breakdown_census_count',
        'histogram-count',
        'parent',
        payload.keyed_histograms.devtools_memory_breakdown_census_count,
        (1, 2, 3)
      ),
      (
        'devtools_memory_breakdown_dominator_tree_count',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.devtools_memory_breakdown_dominator_tree_count,
        (1, 2, 3)
      ),
      (
        'devtools_memory_breakdown_dominator_tree_count',
        'histogram-count',
        'parent',
        payload.keyed_histograms.devtools_memory_breakdown_dominator_tree_count,
        (1, 2, 3)
      ),
      (
        'devtools_perftools_recording_features_used',
        'histogram-boolean',
        'content',
        payload.processes.content.keyed_histograms.devtools_perftools_recording_features_used,
        (1, 2, 3)
      ),
      (
        'devtools_perftools_recording_features_used',
        'histogram-boolean',
        'parent',
        payload.keyed_histograms.devtools_perftools_recording_features_used,
        (1, 2, 3)
      ),
      (
        'devtools_perftools_selected_view_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.devtools_perftools_selected_view_ms,
        (1, 600000, 20)
      ),
      (
        'devtools_perftools_selected_view_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.devtools_perftools_selected_view_ms,
        (1, 600000, 20)
      ),
      (
        'devtools_toolbox_page_reload_delay_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.devtools_toolbox_page_reload_delay_ms,
        (1, 120000, 100)
      ),
      (
        'devtools_warm_toolbox_open_delay_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.devtools_warm_toolbox_open_delay_ms,
        (1, 60000, 100)
      ),
      (
        'devtools_webide_connected_runtime_app_type',
        'histogram-boolean',
        'content',
        payload.processes.content.keyed_histograms.devtools_webide_connected_runtime_app_type,
        (1, 2, 3)
      ),
      (
        'devtools_webide_connected_runtime_app_type',
        'histogram-boolean',
        'parent',
        payload.keyed_histograms.devtools_webide_connected_runtime_app_type,
        (1, 2, 3)
      ),
      (
        'devtools_webide_connected_runtime_id',
        'histogram-boolean',
        'content',
        payload.processes.content.keyed_histograms.devtools_webide_connected_runtime_id,
        (1, 2, 3)
      ),
      (
        'devtools_webide_connected_runtime_id',
        'histogram-boolean',
        'parent',
        payload.keyed_histograms.devtools_webide_connected_runtime_id,
        (1, 2, 3)
      ),
      (
        'devtools_webide_connected_runtime_os',
        'histogram-boolean',
        'content',
        payload.processes.content.keyed_histograms.devtools_webide_connected_runtime_os,
        (1, 2, 3)
      ),
      (
        'devtools_webide_connected_runtime_os',
        'histogram-boolean',
        'parent',
        payload.keyed_histograms.devtools_webide_connected_runtime_os,
        (1, 2, 3)
      ),
      (
        'devtools_webide_connected_runtime_platform_version',
        'histogram-boolean',
        'content',
        payload.processes.content.keyed_histograms.devtools_webide_connected_runtime_platform_version,
        (1, 2, 3)
      ),
      (
        'devtools_webide_connected_runtime_platform_version',
        'histogram-boolean',
        'parent',
        payload.keyed_histograms.devtools_webide_connected_runtime_platform_version,
        (1, 2, 3)
      ),
      (
        'devtools_webide_connected_runtime_processor',
        'histogram-boolean',
        'content',
        payload.processes.content.keyed_histograms.devtools_webide_connected_runtime_processor,
        (1, 2, 3)
      ),
      (
        'devtools_webide_connected_runtime_processor',
        'histogram-boolean',
        'parent',
        payload.keyed_histograms.devtools_webide_connected_runtime_processor,
        (1, 2, 3)
      ),
      (
        'devtools_webide_connected_runtime_type',
        'histogram-boolean',
        'content',
        payload.processes.content.keyed_histograms.devtools_webide_connected_runtime_type,
        (1, 2, 3)
      ),
      (
        'devtools_webide_connected_runtime_type',
        'histogram-boolean',
        'parent',
        payload.keyed_histograms.devtools_webide_connected_runtime_type,
        (1, 2, 3)
      ),
      (
        'devtools_webide_connected_runtime_version',
        'histogram-boolean',
        'content',
        payload.processes.content.keyed_histograms.devtools_webide_connected_runtime_version,
        (1, 2, 3)
      ),
      (
        'devtools_webide_connected_runtime_version',
        'histogram-boolean',
        'parent',
        payload.keyed_histograms.devtools_webide_connected_runtime_version,
        (1, 2, 3)
      ),
      (
        'dom_script_src_encoding',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.dom_script_src_encoding,
        (1, 2, 3)
      ),
      (
        'dom_script_src_encoding',
        'histogram-count',
        'parent',
        payload.keyed_histograms.dom_script_src_encoding,
        (1, 2, 3)
      ),
      (
        'form_filling_required_time_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.form_filling_required_time_ms,
        (1, 300000, 22)
      ),
      (
        'fx_migration_bookmarks_import_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_migration_bookmarks_import_ms,
        (1, 100000, 70)
      ),
      (
        'fx_migration_bookmarks_import_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_migration_bookmarks_import_ms,
        (1, 100000, 70)
      ),
      (
        'fx_migration_bookmarks_jank_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_migration_bookmarks_jank_ms,
        (1, 60000, 20)
      ),
      (
        'fx_migration_bookmarks_jank_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_migration_bookmarks_jank_ms,
        (1, 60000, 20)
      ),
      (
        'fx_migration_bookmarks_quantity',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_migration_bookmarks_quantity,
        (1, 1000, 20)
      ),
      (
        'fx_migration_bookmarks_quantity',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_migration_bookmarks_quantity,
        (1, 1000, 20)
      ),
      (
        'fx_migration_errors',
        'histogram-enumerated',
        'content',
        payload.processes.content.keyed_histograms.fx_migration_errors,
        (1, 12, 13)
      ),
      (
        'fx_migration_errors',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.fx_migration_errors,
        (1, 12, 13)
      ),
      (
        'fx_migration_history_import_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_migration_history_import_ms,
        (1, 100000, 70)
      ),
      (
        'fx_migration_history_import_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_migration_history_import_ms,
        (1, 100000, 70)
      ),
      (
        'fx_migration_history_jank_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_migration_history_jank_ms,
        (1, 60000, 20)
      ),
      (
        'fx_migration_history_jank_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_migration_history_jank_ms,
        (1, 60000, 20)
      ),
      (
        'fx_migration_history_quantity',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_migration_history_quantity,
        (1, 10000, 40)
      ),
      (
        'fx_migration_history_quantity',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_migration_history_quantity,
        (1, 10000, 40)
      ),
      (
        'fx_migration_imported_homepage',
        'histogram-boolean',
        'content',
        payload.processes.content.keyed_histograms.fx_migration_imported_homepage,
        (1, 2, 3)
      ),
      (
        'fx_migration_imported_homepage',
        'histogram-boolean',
        'parent',
        payload.keyed_histograms.fx_migration_imported_homepage,
        (1, 2, 3)
      ),
      (
        'fx_migration_logins_import_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_migration_logins_import_ms,
        (1, 100000, 70)
      ),
      (
        'fx_migration_logins_import_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_migration_logins_import_ms,
        (1, 100000, 70)
      ),
      (
        'fx_migration_logins_jank_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_migration_logins_jank_ms,
        (1, 60000, 20)
      ),
      (
        'fx_migration_logins_jank_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_migration_logins_jank_ms,
        (1, 60000, 20)
      ),
      (
        'fx_migration_logins_quantity',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_migration_logins_quantity,
        (1, 1000, 20)
      ),
      (
        'fx_migration_logins_quantity',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_migration_logins_quantity,
        (1, 1000, 20)
      ),
      (
        'fx_migration_usage',
        'histogram-enumerated',
        'content',
        payload.processes.content.keyed_histograms.fx_migration_usage,
        (1, 12, 13)
      ),
      (
        'fx_migration_usage',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.fx_migration_usage,
        (1, 12, 13)
      ),
      (
        'fx_session_restore_content_collect_data_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_session_restore_content_collect_data_ms,
        (1, 30000, 20)
      ),
      (
        'fx_session_restore_content_collect_data_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_session_restore_content_collect_data_ms,
        (1, 30000, 20)
      ),
      (
        'fx_startup_migration_data_recency',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_startup_migration_data_recency,
        (1, 8760, 50)
      ),
      (
        'fx_startup_migration_data_recency',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_startup_migration_data_recency,
        (1, 8760, 50)
      ),
      (
        'fx_startup_migration_undo_bookmarks_errorcount',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_startup_migration_undo_bookmarks_errorcount,
        (1, 100, 20)
      ),
      (
        'fx_startup_migration_undo_bookmarks_errorcount',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_startup_migration_undo_bookmarks_errorcount,
        (1, 100, 20)
      ),
      (
        'fx_startup_migration_undo_bookmarks_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_startup_migration_undo_bookmarks_ms,
        (1, 60000, 20)
      ),
      (
        'fx_startup_migration_undo_bookmarks_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_startup_migration_undo_bookmarks_ms,
        (1, 60000, 20)
      ),
      (
        'fx_startup_migration_undo_logins_errorcount',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_startup_migration_undo_logins_errorcount,
        (1, 100, 20)
      ),
      (
        'fx_startup_migration_undo_logins_errorcount',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_startup_migration_undo_logins_errorcount,
        (1, 100, 20)
      ),
      (
        'fx_startup_migration_undo_logins_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_startup_migration_undo_logins_ms,
        (1, 60000, 20)
      ),
      (
        'fx_startup_migration_undo_logins_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_startup_migration_undo_logins_ms,
        (1, 60000, 20)
      ),
      (
        'fx_startup_migration_undo_reason',
        'histogram-enumerated',
        'content',
        payload.processes.content.keyed_histograms.fx_startup_migration_undo_reason,
        (1, 10, 11)
      ),
      (
        'fx_startup_migration_undo_reason',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.fx_startup_migration_undo_reason,
        (1, 10, 11)
      ),
      (
        'fx_startup_migration_undo_total_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_startup_migration_undo_total_ms,
        (1, 60000, 20)
      ),
      (
        'fx_startup_migration_undo_total_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_startup_migration_undo_total_ms,
        (1, 60000, 20)
      ),
      (
        'fx_startup_migration_undo_visits_errorcount',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_startup_migration_undo_visits_errorcount,
        (1, 100, 20)
      ),
      (
        'fx_startup_migration_undo_visits_errorcount',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_startup_migration_undo_visits_errorcount,
        (1, 100, 20)
      ),
      (
        'fx_startup_migration_undo_visits_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_startup_migration_undo_visits_ms,
        (1, 60000, 20)
      ),
      (
        'fx_startup_migration_undo_visits_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_startup_migration_undo_visits_ms,
        (1, 60000, 20)
      ),
      (
        'fx_startup_migration_used_recent_browser',
        'histogram-boolean',
        'content',
        payload.processes.content.keyed_histograms.fx_startup_migration_used_recent_browser,
        (1, 2, 3)
      ),
      (
        'fx_startup_migration_used_recent_browser',
        'histogram-boolean',
        'parent',
        payload.keyed_histograms.fx_startup_migration_used_recent_browser,
        (1, 2, 3)
      ),
      (
        'fx_tab_remote_navigation_delay_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_tab_remote_navigation_delay_ms,
        (1, 4000, 100)
      ),
      (
        'fx_tab_remote_navigation_delay_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_tab_remote_navigation_delay_ms,
        (1, 4000, 100)
      ),
      (
        'fx_tabletmode_page_load',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.fx_tabletmode_page_load,
        (1, 100000, 30)
      ),
      (
        'fx_tabletmode_page_load',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.fx_tabletmode_page_load,
        (1, 100000, 30)
      ),
      (
        'fx_urlbar_selected_result_index_by_type',
        'histogram-enumerated',
        'content',
        payload.processes.content.keyed_histograms.fx_urlbar_selected_result_index_by_type,
        (1, 14, 15)
      ),
      (
        'fx_urlbar_selected_result_index_by_type',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.fx_urlbar_selected_result_index_by_type,
        (1, 14, 15)
      ),
      (
        'hsts_priming_request_duration',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.hsts_priming_request_duration,
        (100, 30000, 100)
      ),
      (
        'hsts_priming_request_duration',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.hsts_priming_request_duration,
        (100, 30000, 100)
      ),
      (
        'http3_connecttion_close_code',
        'histogram-enumerated',
        'content',
        payload.processes.content.keyed_histograms.http3_connecttion_close_code,
        (1, 100, 101)
      ),
      (
        'http3_connecttion_close_code',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.http3_connecttion_close_code,
        (1, 100, 101)
      ),
      (
        'http_cache_disposition_3',
        'histogram-categorical',
        'content',
        payload.processes.content.keyed_histograms.http_cache_disposition_3,
        (1, 50, 51)
      ),
      (
        'http_cache_disposition_3',
        'histogram-categorical',
        'parent',
        payload.keyed_histograms.http_cache_disposition_3,
        (1, 50, 51)
      ),
      (
        'http_channel_disposition_upgrade',
        'histogram-categorical',
        'parent',
        payload.keyed_histograms.http_channel_disposition_upgrade,
        (1, 50, 51)
      ),
      (
        'http_child_omt_stats',
        'histogram-categorical',
        'content',
        payload.processes.content.keyed_histograms.http_child_omt_stats,
        (1, 50, 51)
      ),
      (
        'http_traffic_analysis_2',
        'histogram-categorical',
        'parent',
        payload.keyed_histograms.http_traffic_analysis_2,
        (1, 50, 51)
      ),
      (
        'http_traffic_analysis_3',
        'histogram-categorical',
        'parent',
        payload.keyed_histograms.http_traffic_analysis_3,
        (1, 50, 51)
      ),
      (
        'https_only_mode_upgrade_time_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.https_only_mode_upgrade_time_ms,
        (50, 300000, 30)
      ),
      (
        'idle_runnable_budget_overuse_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.idle_runnable_budget_overuse_ms,
        (1, 10000, 10)
      ),
      (
        'idle_runnable_budget_overuse_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.idle_runnable_budget_overuse_ms,
        (1, 10000, 10)
      ),
      (
        'ipc_read_main_thread_latency_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.ipc_read_main_thread_latency_ms,
        (1, 500, 20)
      ),
      (
        'ipc_read_main_thread_latency_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.ipc_read_main_thread_latency_ms,
        (1, 500, 20)
      ),
      (
        'ipc_reply_size',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.ipc_reply_size,
        (1, 8000000, 50)
      ),
      (
        'ipc_reply_size',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.ipc_reply_size,
        (1, 8000000, 50)
      ),
      (
        'ipc_sync_main_latency_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.ipc_sync_main_latency_ms,
        (32, 750, 40)
      ),
      (
        'ipc_sync_main_latency_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.ipc_sync_main_latency_ms,
        (32, 750, 40)
      ),
      (
        'ipc_sync_message_manager_latency_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.ipc_sync_message_manager_latency_ms,
        (32, 750, 40)
      ),
      (
        'ipc_sync_message_manager_latency_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.ipc_sync_message_manager_latency_ms,
        (32, 750, 40)
      ),
      (
        'ipc_sync_receive_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.ipc_sync_receive_ms,
        (32, 750, 40)
      ),
      (
        'ipc_sync_receive_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.ipc_sync_receive_ms,
        (32, 750, 40)
      ),
      (
        'ipc_write_main_thread_latency_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.ipc_write_main_thread_latency_ms,
        (1, 500, 20)
      ),
      (
        'ipc_write_main_thread_latency_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.ipc_write_main_thread_latency_ms,
        (1, 500, 20)
      ),
      (
        'js_telemetry_addon_exceptions',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.js_telemetry_addon_exceptions,
        (1, 2, 3)
      ),
      (
        'js_telemetry_addon_exceptions',
        'histogram-count',
        'parent',
        payload.keyed_histograms.js_telemetry_addon_exceptions,
        (1, 2, 3)
      ),
      (
        'main_thread_runnable_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.main_thread_runnable_ms,
        (1, 10000, 10)
      ),
      (
        'main_thread_runnable_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.main_thread_runnable_ms,
        (1, 10000, 10)
      ),
      (
        'media_codec_used',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.media_codec_used,
        (1, 2, 3)
      ),
      (
        'media_codec_used',
        'histogram-count',
        'parent',
        payload.keyed_histograms.media_codec_used,
        (1, 2, 3)
      ),
      (
        'memory_distribution_among_content',
        'histogram-linear',
        'content',
        payload.processes.content.keyed_histograms.memory_distribution_among_content,
        (1, 200, 100)
      ),
      (
        'memory_distribution_among_content',
        'histogram-linear',
        'parent',
        payload.keyed_histograms.memory_distribution_among_content,
        (1, 200, 100)
      ),
      (
        'narrate_content_by_language_2',
        'histogram-enumerated',
        'content',
        payload.processes.content.keyed_histograms.narrate_content_by_language_2,
        (1, 4, 5)
      ),
      (
        'narrate_content_by_language_2',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.narrate_content_by_language_2,
        (1, 4, 5)
      ),
      (
        'network_cache_entry_count',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.network_cache_entry_count,
        (1, 100000, 100)
      ),
      (
        'network_cache_entry_count_share',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.network_cache_entry_count_share,
        (1, 99, 100)
      ),
      (
        'network_cache_isolation_entry_count_increase',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.network_cache_isolation_entry_count_increase,
        (1, 200, 100)
      ),
      (
        'network_cache_isolation_size_increase',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.network_cache_isolation_size_increase,
        (1, 200, 100)
      ),
      (
        'network_cache_isolation_unique_site_access_count',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.network_cache_isolation_unique_site_access_count,
        (1, 1000, 100)
      ),
      (
        'network_cache_size',
        'histogram-linear',
        'parent',
        payload.keyed_histograms.network_cache_size,
        (1, 4000, 100)
      ),
      (
        'network_cache_size_share',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.network_cache_size_share,
        (1, 99, 100)
      ),
      (
        'network_http_redirect_to_scheme',
        'histogram-categorical',
        'parent',
        payload.keyed_histograms.network_http_redirect_to_scheme,
        (1, 50, 51)
      ),
      (
        'notify_observers_latency_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.notify_observers_latency_ms,
        (3, 512, 20)
      ),
      (
        'notify_observers_latency_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.notify_observers_latency_ms,
        (3, 512, 20)
      ),
      (
        'opengl_compositing_failure_id',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.opengl_compositing_failure_id,
        (1, 2, 3)
      ),
      (
        'opengl_compositing_failure_id',
        'histogram-count',
        'parent',
        payload.keyed_histograms.opengl_compositing_failure_id,
        (1, 2, 3)
      ),
      (
        'permission_request_handling_user_input',
        'histogram-boolean',
        'parent',
        payload.keyed_histograms.permission_request_handling_user_input,
        (1, 2, 3)
      ),
      (
        'permission_request_origin_scheme',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.permission_request_origin_scheme,
        (1, 10, 11)
      ),
      (
        'permission_request_third_party_origin',
        'histogram-boolean',
        'parent',
        payload.keyed_histograms.permission_request_third_party_origin,
        (1, 2, 3)
      ),
      (
        'popup_notification_dismissal_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.popup_notification_dismissal_ms,
        (200, 20000, 50)
      ),
      (
        'popup_notification_dismissal_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.popup_notification_dismissal_ms,
        (200, 20000, 50)
      ),
      (
        'popup_notification_main_action_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.popup_notification_main_action_ms,
        (100, 600000, 40)
      ),
      (
        'popup_notification_main_action_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.popup_notification_main_action_ms,
        (100, 600000, 40)
      ),
      (
        'popup_notification_stats',
        'histogram-enumerated',
        'content',
        payload.processes.content.keyed_histograms.popup_notification_stats,
        (1, 40, 41)
      ),
      (
        'popup_notification_stats',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.popup_notification_stats,
        (1, 40, 41)
      ),
      (
        'preferences_file_load_num_prefs',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.preferences_file_load_num_prefs,
        (1, 10000, 20)
      ),
      (
        'preferences_file_load_num_prefs',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.preferences_file_load_num_prefs,
        (1, 10000, 20)
      ),
      (
        'preferences_file_load_size_b',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.preferences_file_load_size_b,
        (1, 2000000, 20)
      ),
      (
        'preferences_file_load_size_b',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.preferences_file_load_size_b,
        (1, 2000000, 20)
      ),
      (
        'preferences_file_load_time_us',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.preferences_file_load_time_us,
        (1, 1000000, 20)
      ),
      (
        'preferences_file_load_time_us',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.preferences_file_load_time_us,
        (1, 1000000, 20)
      ),
      (
        'presshell_flushes_per_tick',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.presshell_flushes_per_tick,
        (1, 256, 32)
      ),
      (
        'presshell_flushes_per_tick',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.presshell_flushes_per_tick,
        (1, 256, 32)
      ),
      (
        'presshell_layout_total_ms_per_tick',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.presshell_layout_total_ms_per_tick,
        (1, 1000, 50)
      ),
      (
        'presshell_layout_total_ms_per_tick',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.presshell_layout_total_ms_per_tick,
        (1, 1000, 50)
      ),
      (
        'presshell_reqs_per_layout_flush',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.presshell_reqs_per_layout_flush,
        (1, 256, 32)
      ),
      (
        'presshell_reqs_per_layout_flush',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.presshell_reqs_per_layout_flush,
        (1, 256, 32)
      ),
      (
        'print_count',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.print_count,
        (1, 2, 3)
      ),
      ('print_count', 'histogram-count', 'parent', payload.keyed_histograms.print_count, (1, 2, 3)),
      (
        'print_dialog_opened_count',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.print_dialog_opened_count,
        (1, 2, 3)
      ),
      (
        'print_dialog_opened_count',
        'histogram-count',
        'parent',
        payload.keyed_histograms.print_dialog_opened_count,
        (1, 2, 3)
      ),
      (
        'process_crash_submit_attempt',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.process_crash_submit_attempt,
        (1, 2, 3)
      ),
      (
        'process_crash_submit_attempt',
        'histogram-count',
        'parent',
        payload.keyed_histograms.process_crash_submit_attempt,
        (1, 2, 3)
      ),
      (
        'process_crash_submit_success',
        'histogram-boolean',
        'content',
        payload.processes.content.keyed_histograms.process_crash_submit_success,
        (1, 2, 3)
      ),
      (
        'process_crash_submit_success',
        'histogram-boolean',
        'parent',
        payload.keyed_histograms.process_crash_submit_success,
        (1, 2, 3)
      ),
      (
        'pwmgr_manage_sorted',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.pwmgr_manage_sorted,
        (1, 2, 3)
      ),
      (
        'pwmgr_manage_sorted',
        'histogram-count',
        'parent',
        payload.keyed_histograms.pwmgr_manage_sorted,
        (1, 2, 3)
      ),
      (
        'qm_first_initialization_attempt',
        'histogram-boolean',
        'parent',
        payload.keyed_histograms.qm_first_initialization_attempt,
        (1, 2, 3)
      ),
      (
        'qm_init_telemetry_error',
        'histogram-categorical',
        'parent',
        payload.keyed_histograms.qm_init_telemetry_error,
        (1, 75, 76)
      ),
      (
        'refresh_driver_tick_phase_weight',
        'histogram-linear',
        'content',
        payload.processes.content.keyed_histograms.refresh_driver_tick_phase_weight,
        (1, 100, 12)
      ),
      (
        'refresh_driver_tick_phase_weight',
        'histogram-linear',
        'parent',
        payload.keyed_histograms.refresh_driver_tick_phase_weight,
        (1, 100, 12)
      ),
      (
        'rejected_message_manager_message',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.rejected_message_manager_message,
        (1, 2, 3)
      ),
      (
        'rejected_message_manager_message',
        'histogram-count',
        'parent',
        payload.keyed_histograms.rejected_message_manager_message,
        (1, 2, 3)
      ),
      (
        'sandbox_failed_launch_keyed',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.sandbox_failed_launch_keyed,
        (1, 50, 51)
      ),
      (
        'sandbox_rejected_syscalls',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.sandbox_rejected_syscalls,
        (1, 2, 3)
      ),
      (
        'sandbox_rejected_syscalls',
        'histogram-count',
        'parent',
        payload.keyed_histograms.sandbox_rejected_syscalls,
        (1, 2, 3)
      ),
      (
        'search_counts',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.search_counts,
        (1, 2, 3)
      ),
      (
        'search_counts',
        'histogram-count',
        'parent',
        payload.keyed_histograms.search_counts,
        (1, 2, 3)
      ),
      (
        'service_worker_fetch_event_channel_reset_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.service_worker_fetch_event_channel_reset_ms,
        (1, 2000, 25)
      ),
      (
        'service_worker_fetch_event_channel_reset_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.service_worker_fetch_event_channel_reset_ms,
        (1, 2000, 25)
      ),
      (
        'service_worker_fetch_event_dispatch_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.service_worker_fetch_event_dispatch_ms,
        (1, 2000, 25)
      ),
      (
        'service_worker_fetch_event_dispatch_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.service_worker_fetch_event_dispatch_ms,
        (1, 2000, 25)
      ),
      (
        'service_worker_fetch_event_finish_synthesized_response_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.service_worker_fetch_event_finish_synthesized_response_ms,
        (1, 2000, 25)
      ),
      (
        'service_worker_fetch_event_finish_synthesized_response_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.service_worker_fetch_event_finish_synthesized_response_ms,
        (1, 2000, 25)
      ),
      (
        'service_worker_fetch_interception_duration_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.service_worker_fetch_interception_duration_ms,
        (1, 6000, 25)
      ),
      (
        'service_worker_fetch_interception_duration_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.service_worker_fetch_interception_duration_ms,
        (1, 6000, 25)
      ),
      (
        'ssl_time_until_handshake_finished_keyed_by_ka',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.ssl_time_until_handshake_finished_keyed_by_ka,
        (1, 60000, 200)
      ),
      (
        'ssl_time_until_handshake_finished_keyed_by_ka',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.ssl_time_until_handshake_finished_keyed_by_ka,
        (1, 60000, 200)
      ),
      (
        'storage_sync_get_ops_size',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.storage_sync_get_ops_size,
        (1, 100000, 30)
      ),
      (
        'storage_sync_get_ops_size',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.storage_sync_get_ops_size,
        (1, 100000, 30)
      ),
      (
        'storage_sync_remove_ops',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.storage_sync_remove_ops,
        (1, 2, 3)
      ),
      (
        'storage_sync_remove_ops',
        'histogram-count',
        'parent',
        payload.keyed_histograms.storage_sync_remove_ops,
        (1, 2, 3)
      ),
      (
        'storage_sync_set_ops_size',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.storage_sync_set_ops_size,
        (1, 100000, 30)
      ),
      (
        'storage_sync_set_ops_size',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.storage_sync_set_ops_size,
        (1, 100000, 30)
      ),
      (
        'subprocess_abnormal_abort',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.subprocess_abnormal_abort,
        (1, 2, 3)
      ),
      (
        'subprocess_abnormal_abort',
        'histogram-count',
        'parent',
        payload.keyed_histograms.subprocess_abnormal_abort,
        (1, 2, 3)
      ),
      (
        'subprocess_crashes_with_dump',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.subprocess_crashes_with_dump,
        (1, 2, 3)
      ),
      (
        'subprocess_crashes_with_dump',
        'histogram-count',
        'parent',
        payload.keyed_histograms.subprocess_crashes_with_dump,
        (1, 2, 3)
      ),
      (
        'subprocess_kill_hard',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.subprocess_kill_hard,
        (1, 2, 3)
      ),
      (
        'subprocess_kill_hard',
        'histogram-count',
        'parent',
        payload.keyed_histograms.subprocess_kill_hard,
        (1, 2, 3)
      ),
      (
        'subprocess_launch_failure',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.subprocess_launch_failure,
        (1, 2, 3)
      ),
      (
        'subprocess_launch_failure',
        'histogram-count',
        'parent',
        payload.keyed_histograms.subprocess_launch_failure,
        (1, 2, 3)
      ),
      (
        'sync_worker_operation',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.sync_worker_operation,
        (1, 5000, 20)
      ),
      (
        'sync_worker_operation',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.sync_worker_operation,
        (1, 5000, 20)
      ),
      (
        'telemetry_invalid_ping_type_submitted',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.telemetry_invalid_ping_type_submitted,
        (1, 2, 3)
      ),
      (
        'telemetry_invalid_ping_type_submitted',
        'histogram-count',
        'parent',
        payload.keyed_histograms.telemetry_invalid_ping_type_submitted,
        (1, 2, 3)
      ),
      (
        'telemetry_send_failure_type_per_ping',
        'histogram-categorical',
        'parent',
        payload.keyed_histograms.telemetry_send_failure_type_per_ping,
        (1, 50, 51)
      ),
      (
        'thread_wakeup',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.thread_wakeup,
        (1, 60000, 100)
      ),
      (
        'thread_wakeup',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.thread_wakeup,
        (1, 60000, 100)
      ),
      (
        'translated_pages_by_language',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.translated_pages_by_language,
        (1, 2, 3)
      ),
      (
        'translated_pages_by_language',
        'histogram-count',
        'parent',
        payload.keyed_histograms.translated_pages_by_language,
        (1, 2, 3)
      ),
      (
        'translation_opportunities_by_language',
        'histogram-boolean',
        'content',
        payload.processes.content.keyed_histograms.translation_opportunities_by_language,
        (1, 2, 3)
      ),
      (
        'translation_opportunities_by_language',
        'histogram-boolean',
        'parent',
        payload.keyed_histograms.translation_opportunities_by_language,
        (1, 2, 3)
      ),
      (
        'update_check_extended_error_external',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.update_check_extended_error_external,
        (1, 2, 3)
      ),
      (
        'update_check_extended_error_external',
        'histogram-count',
        'parent',
        payload.keyed_histograms.update_check_extended_error_external,
        (1, 2, 3)
      ),
      (
        'update_check_extended_error_notify',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.update_check_extended_error_notify,
        (1, 2, 3)
      ),
      (
        'update_check_extended_error_notify',
        'histogram-count',
        'parent',
        payload.keyed_histograms.update_check_extended_error_notify,
        (1, 2, 3)
      ),
      (
        'uptake_remote_content_result_1',
        'histogram-categorical',
        'content',
        payload.processes.content.keyed_histograms.uptake_remote_content_result_1,
        (1, 50, 51)
      ),
      (
        'uptake_remote_content_result_1',
        'histogram-categorical',
        'parent',
        payload.keyed_histograms.uptake_remote_content_result_1,
        (1, 50, 51)
      ),
      (
        'urlclassifier_cl_keyed_update_time',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.urlclassifier_cl_keyed_update_time,
        (20, 120000, 30)
      ),
      (
        'urlclassifier_cl_keyed_update_time',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.urlclassifier_cl_keyed_update_time,
        (20, 120000, 30)
      ),
      (
        'urlclassifier_complete_remote_status2',
        'histogram-enumerated',
        'content',
        payload.processes.content.keyed_histograms.urlclassifier_complete_remote_status2,
        (1, 16, 17)
      ),
      (
        'urlclassifier_complete_remote_status2',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.urlclassifier_complete_remote_status2,
        (1, 16, 17)
      ),
      (
        'urlclassifier_complete_server_response_time',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.urlclassifier_complete_server_response_time,
        (1, 5000, 15)
      ),
      (
        'urlclassifier_complete_server_response_time',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.urlclassifier_complete_server_response_time,
        (1, 5000, 15)
      ),
      (
        'urlclassifier_complete_timeout2',
        'histogram-boolean',
        'content',
        payload.processes.content.keyed_histograms.urlclassifier_complete_timeout2,
        (1, 2, 3)
      ),
      (
        'urlclassifier_complete_timeout2',
        'histogram-boolean',
        'parent',
        payload.keyed_histograms.urlclassifier_complete_timeout2,
        (1, 2, 3)
      ),
      (
        'urlclassifier_update_error',
        'histogram-enumerated',
        'content',
        payload.processes.content.keyed_histograms.urlclassifier_update_error,
        (1, 16, 17)
      ),
      (
        'urlclassifier_update_error',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.urlclassifier_update_error,
        (1, 16, 17)
      ),
      (
        'urlclassifier_update_remote_network_error',
        'histogram-enumerated',
        'content',
        payload.processes.content.keyed_histograms.urlclassifier_update_remote_network_error,
        (1, 30, 31)
      ),
      (
        'urlclassifier_update_remote_network_error',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.urlclassifier_update_remote_network_error,
        (1, 30, 31)
      ),
      (
        'urlclassifier_update_remote_status2',
        'histogram-enumerated',
        'content',
        payload.processes.content.keyed_histograms.urlclassifier_update_remote_status2,
        (1, 16, 17)
      ),
      (
        'urlclassifier_update_remote_status2',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.urlclassifier_update_remote_status2,
        (1, 16, 17)
      ),
      (
        'urlclassifier_update_server_response_time',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.urlclassifier_update_server_response_time,
        (1, 100000, 30)
      ),
      (
        'urlclassifier_update_server_response_time',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.urlclassifier_update_server_response_time,
        (1, 100000, 30)
      ),
      (
        'urlclassifier_update_timeout',
        'histogram-enumerated',
        'content',
        payload.processes.content.keyed_histograms.urlclassifier_update_timeout,
        (1, 4, 5)
      ),
      (
        'urlclassifier_update_timeout',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.urlclassifier_update_timeout,
        (1, 4, 5)
      ),
      (
        'video_hidden_play_time_percentage',
        'histogram-linear',
        'content',
        payload.processes.content.keyed_histograms.video_hidden_play_time_percentage,
        (1, 100, 50)
      ),
      (
        'video_hidden_play_time_percentage',
        'histogram-linear',
        'parent',
        payload.keyed_histograms.video_hidden_play_time_percentage,
        (1, 100, 50)
      ),
      (
        'video_inferred_decode_suspend_percentage',
        'histogram-linear',
        'content',
        payload.processes.content.keyed_histograms.video_inferred_decode_suspend_percentage,
        (1, 100, 50)
      ),
      (
        'video_inferred_decode_suspend_percentage',
        'histogram-linear',
        'parent',
        payload.keyed_histograms.video_inferred_decode_suspend_percentage,
        (1, 100, 50)
      ),
      (
        'video_inter_keyframe_average_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.video_inter_keyframe_average_ms,
        (1, 60000, 100)
      ),
      (
        'video_inter_keyframe_average_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.video_inter_keyframe_average_ms,
        (1, 60000, 100)
      ),
      (
        'video_inter_keyframe_max_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.video_inter_keyframe_max_ms,
        (1, 60000, 100)
      ),
      (
        'video_inter_keyframe_max_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.video_inter_keyframe_max_ms,
        (1, 60000, 100)
      ),
      (
        'video_suspend_recovery_time_ms',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.video_suspend_recovery_time_ms,
        (1, 10000, 100)
      ),
      (
        'video_suspend_recovery_time_ms',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.video_suspend_recovery_time_ms,
        (1, 10000, 100)
      ),
      (
        'video_unblackinglisting_dxva_driver_runtime_status',
        'histogram-enumerated',
        'content',
        payload.processes.content.keyed_histograms.video_unblackinglisting_dxva_driver_runtime_status,
        (1, 10, 11)
      ),
      (
        'weave_engine_sync_errors',
        'histogram-count',
        'content',
        payload.processes.content.keyed_histograms.weave_engine_sync_errors,
        (1, 2, 3)
      ),
      (
        'weave_engine_sync_errors',
        'histogram-count',
        'parent',
        payload.keyed_histograms.weave_engine_sync_errors,
        (1, 2, 3)
      ),
      (
        'web_permission_cleared',
        'histogram-enumerated',
        'content',
        payload.processes.content.keyed_histograms.web_permission_cleared,
        (1, 6, 7)
      ),
      (
        'web_permission_cleared',
        'histogram-enumerated',
        'parent',
        payload.keyed_histograms.web_permission_cleared,
        (1, 6, 7)
      ),
      (
        'webext_background_page_load_ms_by_addonid',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.webext_background_page_load_ms_by_addonid,
        (1, 60000, 100)
      ),
      (
        'webext_browseraction_popup_open_ms_by_addonid',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.webext_browseraction_popup_open_ms_by_addonid,
        (1, 50000, 100)
      ),
      (
        'webext_browseraction_popup_preload_result_count_by_addonid',
        'histogram-categorical',
        'parent',
        payload.keyed_histograms.webext_browseraction_popup_preload_result_count_by_addonid,
        (1, 50, 51)
      ),
      (
        'webext_content_script_injection_ms_by_addonid',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.webext_content_script_injection_ms_by_addonid,
        (1, 50000, 100)
      ),
      (
        'webext_content_script_injection_ms_by_addonid',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.webext_content_script_injection_ms_by_addonid,
        (1, 50000, 100)
      ),
      (
        'webext_extension_startup_ms_by_addonid',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.webext_extension_startup_ms_by_addonid,
        (1, 50000, 100)
      ),
      (
        'webext_pageaction_popup_open_ms_by_addonid',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.webext_pageaction_popup_open_ms_by_addonid,
        (1, 50000, 100)
      ),
      (
        'webext_storage_local_get_ms_by_addonid',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.webext_storage_local_get_ms_by_addonid,
        (1, 50000, 100)
      ),
      (
        'webext_storage_local_get_ms_by_addonid',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.webext_storage_local_get_ms_by_addonid,
        (1, 50000, 100)
      ),
      (
        'webext_storage_local_idb_get_ms_by_addonid',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.webext_storage_local_idb_get_ms_by_addonid,
        (1, 50000, 100)
      ),
      (
        'webext_storage_local_idb_get_ms_by_addonid',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.webext_storage_local_idb_get_ms_by_addonid,
        (1, 50000, 100)
      ),
      (
        'webext_storage_local_idb_set_ms_by_addonid',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.webext_storage_local_idb_set_ms_by_addonid,
        (1, 50000, 100)
      ),
      (
        'webext_storage_local_idb_set_ms_by_addonid',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.webext_storage_local_idb_set_ms_by_addonid,
        (1, 50000, 100)
      ),
      (
        'webext_storage_local_set_ms_by_addonid',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.webext_storage_local_set_ms_by_addonid,
        (1, 50000, 100)
      ),
      (
        'webext_storage_local_set_ms_by_addonid',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.webext_storage_local_set_ms_by_addonid,
        (1, 50000, 100)
      ),
      (
        'webext_user_script_injection_ms_by_addonid',
        'histogram-exponential',
        'content',
        payload.processes.content.keyed_histograms.webext_user_script_injection_ms_by_addonid,
        (1, 50000, 100)
      ),
      (
        'webext_user_script_injection_ms_by_addonid',
        'histogram-exponential',
        'parent',
        payload.keyed_histograms.webext_user_script_injection_ms_by_addonid,
        (1, 50000, 100)
      )
    ] AS metrics
  FROM
    sampled_data
),
flattened_metrics AS (
  SELECT
    submission_date,
    sample_id,
    client_id,
    os,
    app_version,
    app_build_id,
    channel,
    process,
    metrics.name AS metric,
    metrics.metric_type AS metric_type,
    bucket_range,
    value.key AS key,
    value.value AS value
  FROM
    grouped_metrics
  CROSS JOIN
    UNNEST(metrics) AS metrics
  CROSS JOIN
    UNNEST(metrics.value) AS value
),
aggregated AS (
  SELECT
    submission_date,
    sample_id,
    client_id,
    os,
    app_version,
    app_build_id,
    channel,
    process,
    metric,
    metric_type,
    key,
    ARRAY_AGG(bucket_range) AS bucket_range,
    ARRAY_AGG(value) AS value
  FROM
    flattened_metrics
  GROUP BY
    sample_id,
    client_id,
    submission_date,
    os,
    app_version,
    app_build_id,
    channel,
    process,
    metric,
    metric_type,
    key
)
SELECT
  submission_date,
  sample_id,
  client_id,
  os,
  app_version,
  app_build_id,
  channel,
  ARRAY_AGG(
    STRUCT<
      metric STRING,
      metric_type STRING,
      key STRING,
      process STRING,
      agg_type STRING,
      bucket_range STRUCT<first_bucket INT64, last_bucket INT64, num_buckets INT64>,
      value ARRAY<STRUCT<key STRING, value INT64>>
    >(
      metric,
      metric_type,
      key,
      process,
      'summed_histogram',
      bucket_range[OFFSET(0)],
      udf_aggregate_json_sum(value)
    )
  ) AS histogram_aggregates
FROM
  aggregated
GROUP BY
  sample_id,
  client_id,
  submission_date,
  os,
  app_version,
  app_build_id,
  channel
