1// Copyright 2014 The Chromium Authors 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5syntax = "proto2"; 6 7option optimize_for = LITE_RUNTIME; 8option java_package = "org.chromium.components.metrics"; 9 10option java_outer_classname = "ChromeUserMetricsExtensionProtos"; 11 12package metrics; 13 14import "cast_logs.proto"; 15import "chrome_os_app_list_launch_event.proto"; 16import "custom_tab_session.proto"; 17import "histogram_event.proto"; 18import "omnibox_event.proto"; 19 20import "printer_event.proto"; 21import "reporting_info.proto"; 22import "sampled_profile.proto"; 23import "structured_data.proto"; 24import "system_profile.proto"; 25import "trace_log.proto"; 26import "translate_event.proto"; 27import "user_action_event.proto"; 28import "user_demographics.proto"; 29 30// Next tag: 30 31message ChromeUserMetricsExtension { 32 // The product (i.e. end user application) for a given UMA log. 33 enum Product { 34 // Google Chrome product family. 35 CHROME = 0; 36 37 // UMA metrics from Android Webview. 38 ANDROID_WEBVIEW = 20; 39 40 // Cast Assistant 41 CAST_ASSISTANT = 25; 42 43 // Devices such as Chromecast, Android TVs, and smart speakers and displays. 44 CAST = 35; 45 46 // UMA metrics from Android WebLayer. 47 ANDROID_WEBLAYER = 56; 48 } 49 50 // The product corresponding to this log. The field type is int32 instead of 51 // Product so that downstream users of the Chromium metrics component can 52 // introduce products without needing to make changes to the Chromium code 53 // (though they still need to add the new product to the server-side enum). 54 // Note: The default value is Chrome, so Chrome products will not transmit 55 // this field. 56 optional int32 product = 10 [default = 0]; 57 58 // The id of the client install that generated these events. 59 // 60 // For Chrome clients, this id is unique to a top-level (one level above the 61 // "Default" directory) Chrome user data directory [1], and so is shared among 62 // all Chrome user profiles contained in this user data directory. 63 // This client_id may not be unique across platforms. Notably, ChromeOS and 64 // Lacros are different platforms yet report the same client_id for the same 65 // device. 66 // An id of 0 is reserved for test data (monitoring and internal testing) and 67 // should normally be ignored in analysis of the data. 68 // [1] http://www.chromium.org/user-experience/user-data-directory 69 optional fixed64 client_id = 1; 70 71 // The session id for this user. 72 // Values such as tab ids are only meaningful within a particular session. 73 // The client keeps track of the session id and sends it with each event. 74 // The session id is simply an integer that is incremented each time the user 75 // relaunches Chrome. 76 optional int32 session_id = 2; 77 78 // The id associated with a user entity that generated these events. These 79 // user IDs are only associated with users on device. Their generation is not 80 // based on any other ID. 81 // 82 // This field is not populated on non-Chrome OS platforms. 83 // 84 // For Chrome OS, this id refers to a device user entity. This field will be 85 // captured when a log is first opened. If there is no user logged in at the 86 // time the log is opened, then this field will be unset. All ephemeral (i.e. 87 // guest, kiosk) users will have this field unset. 88 optional fixed64 user_id = 24; 89 90 // A client-managed id that functions as a sequence number for the log record. 91 // Clients are expected to maintain a counter, incrementing it (by 1) for each 92 // record they create, and populate this field. Each record_id is expected to 93 // be unique when scoped to a given client_id. It is further expected that the 94 // record_id values associated to a given client_id form an uninterrupted 95 // numeric sequence (i.e. k, k+1, k+2, k+3, ...), allowing for the detection 96 // of dropped, or otherwise lost, records. 97 optional int64 record_id = 28; 98 99 // A client-managed id that functions as a sequence number for the log record. 100 // Clients are expected to maintain a counter, incrementing it (by 1) for each 101 // record they finalize, and populate this field. Each record_id is expected 102 // to be unique when scoped to a given client_id. It is further expected that 103 // the record_id values associated to a given client_id form an uninterrupted 104 // numeric sequence (i.e. k, k+1, k+2, k+3, ...), allowing for the detection 105 // of dropped, or otherwise lost, finalized records. 106 optional int64 finalized_record_id = 29; 107 108 // Next tag: 4 109 message RealLocalTime { 110 // The source of the timestamp. 111 enum TimeSource { 112 UNSPECIFIED = 0; 113 114 // The time on the local machine. 115 CLIENT_CLOCK = 1; 116 117 // The time derived from server information provided by the 118 // NetworkTimeTracker a.k.a. "sane time" system. See 119 // https://www.chromium.org/developers/design-documents/sane-time 120 NETWORK_TIME_CLOCK = 2; 121 } 122 123 optional TimeSource time_source = 1; 124 125 // |time_sec| is in seconds since epoch. 126 optional int64 time_sec = 2; 127 128 // |time_zone_offset_from_gmt_sec| is in seconds. 129 // Only logged in |time_log_closed| entries, not |time_log_created| entries. 130 // (Populating this field when creating a log slows down startup too much.) 131 optional int32 time_zone_offset_from_gmt_sec = 3; 132 } 133 134 // These times are set for "ongoing" UMA logs. For two other types 135 // of UMA logs, these values are omitted: 136 // - logs recovered from a previous run of Chrome ("persisted UMA"), such as 137 // one that didn't shut down cleanly. 138 // - the initial stability log. 139 // 140 // Warning: in some cases |time_log_created| can contain events that happened 141 // slightly before this timestamp. If you only care about differences of more 142 // than a minute, you can skip reading this section. In particular, at the 143 // time of writing, the "initial metric log" includes all metrics from startup 144 // until it is closed, which happens 60 seconds after startup on desktop 145 // platforms and 15 seconds after startup on mobile platforms. (See 146 // components/metrics/metrics_scheduler.cc kInitialIntervalSeconds.) Yet, the 147 // initial metrics log is only created 30 seconds after startup on desktop 148 // platforms and 5 seconds after startup on mobile platforms. (See 149 // components/metrics/metrics_service.cc kInitializationDelaySeconds.) This 150 // means histograms that are stored in a record could have been emitted up to 151 // 30 seconds before the log was created. This logic may change in the 152 // future; see http://crbug.com/1171830 153 optional RealLocalTime time_log_created = 25; 154 optional RealLocalTime time_log_closed = 26; 155 156 // Information about the user's browser and system configuration. 157 optional SystemProfileProto system_profile = 3; 158 159 // The user's demographic information. This data is made available to Chrome 160 // via syncable priority pref, so is only available if the user is signed-in 161 // and syncing. 162 optional UserDemographicsProto user_demographics = 21; 163 164 // This message will log one or more of the following event types: 165 repeated UserActionEventProto user_action_event = 4; 166 repeated OmniboxEventProto omnibox_event = 5; 167 repeated HistogramEventProto histogram_event = 6; 168 169 repeated TranslateEventProto translate_event = 15; 170 repeated PrinterEventProto printer_event = 16; 171 172 repeated ChromeOSAppListLaunchEventProto chrome_os_app_list_launch_event = 20; 173 174 optional StructuredDataProto structured_data = 23; 175 176 // A list of all collected sample-based profiles since the last UMA upload. 177 repeated SampledProfile sampled_profile = 11; 178 179 // Additional data related with Cast-enabled devices. 180 optional CastLogsProto cast_logs = 12; 181 182 // The ReportingInfo message sent in the X-Chrome-UMA-ReportingInfo header. 183 // Copied in by the receiving server. 184 optional ReportingInfo reporting_info = 17; 185 186 // The Chrome traces obtained during the current session. The start time, 187 // duration and details depend on the experiment triggers in the current 188 // session. This field is uploaded as independent logs, which contain only 189 // session id and core system profile fields, apart from this field. 190 repeated TraceLog trace_log = 19; 191 192 // Information about a Custom Tabs session, recorded in the log when the 193 // a CCT session ended. If custom tabs are opened and closed multiple times 194 // within the same log session, only the last one will be recorded. This is 195 // used to identify applications that use Custom Tabs in an abusive way. This 196 // is specific to Android. 197 optional CustomTabSessionProto custom_tab_session = 27; 198} 199