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