sessions.proto 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. //
  15. // Instructions for updating this file:
  16. //
  17. // 1. Get the session_event.proto from the backend
  18. // 2. Copy everything below the options, and past it here below the package
  19. // declaraction.
  20. // 3. Remove all the datapol.semantic_type tags
  21. // 4. Remove "wireless_android_play_playlog." from
  22. // "wireless_android_play_playlog.NetworkConnectionInfo"
  23. // 5. Any new proto fields of type string, repeated, or bytes must be specified
  24. // in the sessions.options file as "type:FT_POINTER"
  25. // 6. Remove any Lint comments (eg. IfChanged lines)
  26. // 7. Remove any optional specifiers
  27. //
  28. syntax = "proto3";
  29. package firebase.appquality.sessions;
  30. // Contains the relevant information around an App Quality Session.
  31. // See go/app-quality-unified-session-definition for more details.
  32. // Next tag: 4
  33. message SessionEvent {
  34. // The type of event being reported.
  35. EventType event_type = 1;
  36. // Information about the session triggering the event.
  37. SessionInfo session_data = 2;
  38. // Information about the running application.
  39. ApplicationInfo application_info = 3;
  40. }
  41. // Enum denoting all possible session event types.
  42. // Next tag: 2
  43. enum EventType {
  44. EVENT_TYPE_UNKNOWN = 0;
  45. // This event type is fired as soon as a new session begins.
  46. SESSION_START = 1;
  47. }
  48. // To describe the network connectivity of the client.
  49. // Copied from android/play/playlog/proto/clientanalytics.proto
  50. // Next tag: 3
  51. message NetworkConnectionInfo {
  52. enum NetworkType {
  53. MOBILE = 0;
  54. WIFI = 1;
  55. MOBILE_MMS = 2;
  56. MOBILE_SUPL = 3;
  57. MOBILE_DUN = 4;
  58. MOBILE_HIPRI = 5;
  59. WIMAX = 6;
  60. BLUETOOTH = 7;
  61. DUMMY = 8;
  62. ETHERNET = 9;
  63. MOBILE_FOTA = 10;
  64. MOBILE_IMS = 11;
  65. MOBILE_CBS = 12;
  66. WIFI_P2P = 13;
  67. MOBILE_IA = 14;
  68. MOBILE_EMERGENCY = 15;
  69. PROXY = 16;
  70. VPN = 17;
  71. }
  72. enum MobileSubtype {
  73. UNKNOWN_MOBILE_SUBTYPE = 0;
  74. GPRS = 1;
  75. EDGE = 2;
  76. UMTS = 3;
  77. CDMA = 4;
  78. EVDO_0 = 5;
  79. EVDO_A = 6;
  80. RTT = 7;
  81. HSDPA = 8;
  82. HSUPA = 9;
  83. HSPA = 10;
  84. IDEN = 11;
  85. EVDO_B = 12;
  86. LTE = 13;
  87. EHRPD = 14;
  88. HSPAP = 15;
  89. GSM = 16;
  90. TD_SCDMA = 17;
  91. IWLAN = 18;
  92. LTE_CA = 19;
  93. NR = 20;
  94. // COMBINED has value -1 in NetworkIdentity.java, but is given the value
  95. // 100 here to save (disk) space. The value -1 takes up the full 10 bytes in
  96. // a varint for enums, but the value 100 only takes up 1 byte.
  97. COMBINED = 100;
  98. }
  99. // The current network connectivity type when the event was logged in the
  100. // client
  101. NetworkType network_type = 1;
  102. // The current mobile connectivity subtype when the event was logged in the
  103. // client
  104. MobileSubtype mobile_subtype = 2;
  105. }
  106. // Contains session-specific information relating to the event being uploaded.
  107. // Next tag: 9
  108. message SessionInfo {
  109. // A globally unique identifier for the session.
  110. string session_id = 1;
  111. // Will point to the first Session for the run of the app.
  112. // For the first session, this will be the same as session_id.
  113. string first_session_id = 7;
  114. // What order this Session came in this run of the app. For the first Session
  115. // this will be 0.
  116. int32 session_index = 8;
  117. // Identifies a unique device+app installation: go/firebase-installations
  118. string firebase_installation_id = 3;
  119. // The device-reported timestamp at which the event occurred.
  120. int64 event_timestamp_us = 4;
  121. // The data collection status for each related SDK.
  122. DataCollectionStatus data_collection_status = 6;
  123. }
  124. // Contains the data collection status for each related SDK.
  125. // Next tag: 4
  126. message DataCollectionStatus {
  127. // The collection status of the FirePerf SDK.
  128. DataCollectionState performance = 1;
  129. // The collection status for the Crashlytics SDK.
  130. DataCollectionState crashlytics = 2;
  131. // Any sampling rate being applied to these events on device.
  132. // 1.0 implies no sampling.
  133. double session_sampling_rate = 3;
  134. }
  135. // Enum denoting all possible states for SDK data collection.
  136. // Next tag: 6
  137. enum DataCollectionState {
  138. COLLECTION_UNKNOWN = 0;
  139. // This product SDK is not present in this version of the app.
  140. COLLECTION_SDK_NOT_INSTALLED = 1;
  141. // The product SDK is present and collecting all product-level events.
  142. COLLECTION_ENABLED = 2;
  143. // The product SDK is present but data collection for it has been locally
  144. // disabled.
  145. COLLECTION_DISABLED = 3;
  146. // The product SDK is present but data collection has been remotely disabled.
  147. COLLECTION_DISABLED_REMOTE = 4;
  148. // Indicates that the product SDK is present, but session data is being
  149. // collected, but the product-level events are not being uploaded.
  150. COLLECTION_SAMPLED = 5;
  151. }
  152. // App-level information collected from the device.
  153. // Next tag: 10
  154. message ApplicationInfo {
  155. // Commonly known as the GMP App Id
  156. string app_id = 1;
  157. // The manufacturer supplied device model name. Eg. 'N5502L'
  158. string device_model = 2;
  159. // The development platform used by the app. Eg. 'Unity', 'Flutter'
  160. string development_platform_name = 3;
  161. // The version of the development platform in use by the app. Eg. 2020.3.33f1
  162. string development_platform_version = 4;
  163. // The version of the Firebase-Sessions SDK in use
  164. string session_sdk_version = 7;
  165. // The operating system version
  166. string os_version = 9;
  167. // The destination environment to send the logs to
  168. LogEnvironment log_environment = 8;
  169. oneof platform_info {
  170. // App info relevant only to Android apps
  171. AndroidApplicationInfo android_app_info = 5;
  172. // App info relevant only to Apple apps
  173. AppleApplicationInfo apple_app_info = 6;
  174. }
  175. }
  176. // Android-specific app information
  177. // In addition to these fields, the Firelog SDK also collects:
  178. // - application_build
  179. // - mcc_mnc
  180. // - sdk_version(app's build version)
  181. // - manufacturer
  182. // - model
  183. // - country
  184. // - network_connection_info
  185. // Next tag: 4
  186. message AndroidApplicationInfo {
  187. // The applications package name. Eg. com.google.search
  188. string package_name = 1;
  189. // The version name as specified in the app's manifest
  190. // https://developer.android.com/guide/topics/manifest/manifest-element#vname
  191. string version_name = 3;
  192. }
  193. // Apple-specific app information
  194. // In addition to these fields, the Firelog SDK also collects:
  195. // - application_build
  196. // - application_version
  197. // - os_full_version
  198. // - model
  199. // - country
  200. // Next tag: 7
  201. message AppleApplicationInfo {
  202. // The application's display version, eg. 1.2.3
  203. string bundle_short_version = 1;
  204. // The application's build version. Eg. 123
  205. string app_build_version = 6;
  206. // Describes the network connectivity of the device
  207. NetworkConnectionInfo network_connection_info = 3;
  208. // Collects the OS running. Eg. iOS, iPadOs, tvOS, etc.
  209. OsName os_name = 4;
  210. // The mobile country code / mobile network code (MCC/MNC) of the device's
  211. // SIM/home network (not the device's active network)
  212. // e.g., 310004 for Verizon USA.
  213. string mcc_mnc = 5;
  214. }
  215. // The name of the operating system on which the application is running.
  216. // Currently Apple only.
  217. enum OsName {
  218. UNKNOWN_OSNAME = 0;
  219. MACOS = 1;
  220. MACCATALYST = 2;
  221. IOS_ON_MAC = 3;
  222. IOS = 4;
  223. TVOS = 5;
  224. WATCHOS = 6;
  225. IPADOS = 7;
  226. // Indicates no data was provided by the device (old sdk, Android)
  227. UNSPECIFIED = 8;
  228. }
  229. // Enum containing the destination environment the events will be sent to.
  230. enum LogEnvironment {
  231. LOG_ENVIRONMENT_UNKNOWN = 0;
  232. LOG_ENVIRONMENT_AUTOPUSH = 1;
  233. LOG_ENVIRONMENT_STAGING = 2;
  234. LOG_ENVIRONMENT_PROD = 3;
  235. }