sessions.proto 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. import "clientanalytics.proto";
  30. package firebase.appquality.sessions;
  31. // Contains the relevant information around an App Quality Session.
  32. // See go/app-quality-unified-session-definition for more details.
  33. // Next tag: 4
  34. message SessionEvent {
  35. // The type of event being reported.
  36. EventType event_type = 1;
  37. // Information about the session triggering the event.
  38. SessionInfo session_data = 2;
  39. // Information about the running application.
  40. ApplicationInfo application_info = 3;
  41. }
  42. // Enum denoting all possible session event types.
  43. // Next tag: 2
  44. enum EventType {
  45. EVENT_TYPE_UNKNOWN = 0;
  46. // This event type is fired as soon as a new session begins.
  47. SESSION_START = 1;
  48. }
  49. // Contains session-specific information relating to the event being uploaded.
  50. // Next tag: 7
  51. message SessionInfo {
  52. // A globally unique identifier for the session.
  53. string session_id = 1;
  54. // The unique identifier for the session that preceded this one on the device.
  55. // This will be the empty string if there was no previous session.
  56. string previous_session_id = 2;
  57. // Identifies a unique device+app installation: go/firebase-installations
  58. string firebase_installation_id = 3;
  59. // The device-reported timestamp at which the event occurred.
  60. int64 event_timestamp_us = 4;
  61. // The data collection status for each related SDK.
  62. DataCollectionStatus data_collection_status = 6;
  63. }
  64. // Contains the data collection status for each related SDK.
  65. // Next tag: 4
  66. message DataCollectionStatus {
  67. // The collection status of the FirePerf SDK.
  68. DataCollectionState performance = 1;
  69. // The collection status for the Crashlytics SDK.
  70. DataCollectionState crashlytics = 2;
  71. // Any sampling rate being applied to these events on device.
  72. // 1.0 implies no sampling.
  73. float session_sampling_rate = 3;
  74. }
  75. // Enum denoting all possible states for SDK data collection.
  76. // Next tag: 6
  77. enum DataCollectionState {
  78. COLLECTION_UNKNOWN = 0;
  79. // This product SDK is not present in this version of the app.
  80. COLLECTION_SDK_NOT_INSTALLED = 1;
  81. // The product SDK is present and collecting all product-level events.
  82. COLLECTION_ENABLED = 2;
  83. // The product SDK is present but data collection for it has been locally
  84. // disabled.
  85. COLLECTION_DISABLED = 3;
  86. // The product SDK is present but data collection has been remotely disabled.
  87. COLLECTION_DISABLED_REMOTE = 4;
  88. // Indicates that the product SDK is present, but session data is being
  89. // collected, but the product-level events are not being uploaded.
  90. COLLECTION_SAMPLED = 5;
  91. }
  92. // App-level information collected from the device.
  93. // Next tag: 9
  94. message ApplicationInfo {
  95. // Commonly known as the GMP App Id
  96. string app_id = 1;
  97. // The manufacturer supplied device model name. Eg. 'N5502L'
  98. string device_model = 2;
  99. // The development platform used by the app. Eg. 'Unity', 'Flutter'
  100. string development_platform_name = 3;
  101. // The version of the development platform in use by the app. Eg. 2020.3.33f1
  102. string development_platform_version = 4;
  103. // The version of the Firebase-Sessions SDK in use
  104. string session_sdk_version = 7;
  105. // The destination environment to send the logs to
  106. LogEnvironment log_environment = 8;
  107. oneof platform_info {
  108. // App info relevant only to Android apps
  109. AndroidApplicationInfo android_app_info = 5;
  110. // App info relevant only to Apple apps
  111. AppleApplicationInfo apple_app_info = 6;
  112. }
  113. }
  114. // Android-specific app information
  115. // In addition to these fields, the Firelog SDK also collects:
  116. // - application_build
  117. // - mcc_mnc
  118. // - sdk_version(app's build version)
  119. // - manufacturer
  120. // - model
  121. // - country
  122. // - network_connection_info
  123. // Next tag: 4
  124. message AndroidApplicationInfo {
  125. // The applications package name. Eg. com.google.search
  126. string package_name = 1;
  127. // The version name as specified in the app's manifest
  128. // https://developer.android.com/guide/topics/manifest/manifest-element#vname
  129. string version_name = 3;
  130. }
  131. // Apple-specific app information
  132. // In addition to these fields, the Firelog SDK also collects:
  133. // - application_build
  134. // - application_version
  135. // - os_full_version
  136. // - model
  137. // - country
  138. // Next tag: 6
  139. message AppleApplicationInfo {
  140. // The application's bundle id. Eg. com.google.search
  141. string bundle_short_version = 1;
  142. // Describes the network connectivity of the device
  143. NetworkConnectionInfo network_connection_info = 3;
  144. // Collects the OS running. Eg. iOS, iPadOs, tvOS, etc.
  145. OsName os_name = 4;
  146. // The mobile country code / mobile network code (MCC/MNC) of the device's
  147. // SIM/home network (not the device's active network)
  148. // e.g., 310004 for Verizon USA.
  149. string mcc_mnc = 5;
  150. }
  151. // The name of the operating system on which the application is running.
  152. // Currently Apple only.
  153. enum OsName {
  154. UNKNOWN_OSNAME = 0;
  155. MACOS = 1;
  156. MACCATALYST = 2;
  157. IOS_ON_MAC = 3;
  158. IOS = 4;
  159. TVOS = 5;
  160. WATCHOS = 6;
  161. IPADOS = 7;
  162. // Indicates no data was provided by the device (old sdk, Android)
  163. UNSPECIFIED = 8;
  164. }
  165. // Enum containing the destination environment the events will be sent to.
  166. enum LogEnvironment {
  167. LOG_ENVIRONMENT_UNKNOWN = 0;
  168. LOG_ENVIRONMENT_AUTOPUSH = 1;
  169. LOG_ENVIRONMENT_STAGING = 2;
  170. LOG_ENVIRONMENT_PROD = 3;
  171. }