@grafana/faro-react-native 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/android/build.gradle +118 -36
  2. package/android/consumer-proguard-rules.pro +2 -0
  3. package/android/src/main/java/com/grafana/faro/reactnative/ANRTracker.kt +61 -9
  4. package/android/src/main/java/com/grafana/faro/reactnative/AnrThreadDumpParser.kt +70 -0
  5. package/android/src/main/java/com/grafana/faro/reactnative/ApplicationExitTraceReader.kt +142 -0
  6. package/android/src/main/java/com/grafana/faro/reactnative/FaroAnrCache.kt +163 -0
  7. package/android/src/main/java/com/grafana/faro/reactnative/FaroAnrReporter.kt +163 -0
  8. package/android/src/main/java/com/grafana/faro/reactnative/FaroCrashReporter.kt +243 -50
  9. package/android/src/main/java/com/grafana/faro/reactnative/FaroCrashTraceCache.kt +75 -0
  10. package/android/src/main/java/com/grafana/faro/reactnative/FaroNativeCrashTrace.kt +39 -0
  11. package/android/src/main/java/com/grafana/faro/reactnative/FaroReactNativeModule.kt +99 -8
  12. package/android/src/main/java/com/grafana/faro/reactnative/FaroReactNativePackage.kt +1 -0
  13. package/android/src/main/java/com/grafana/faro/reactnative/FaroUncaughtExceptionHandler.kt +62 -0
  14. package/android/src/main/java/com/grafana/faro/reactnative/TombstoneBacktraceFormatter.kt +117 -0
  15. package/android/src/main/java/com/grafana/faro/reactnative/TombstoneModels.kt +35 -0
  16. package/android/src/main/java/com/grafana/faro/reactnative/TombstoneWireParser.kt +235 -0
  17. package/android/src/main/proto/tombstone.proto +62 -0
  18. package/android/src/test/java/com/grafana/faro/reactnative/AnrStackFiltersTest.kt +28 -0
  19. package/android/src/test/java/com/grafana/faro/reactnative/AnrThreadDumpParserTest.kt +38 -0
  20. package/android/src/test/java/com/grafana/faro/reactnative/FaroAnrCacheTest.kt +81 -0
  21. package/android/src/test/java/com/grafana/faro/reactnative/TombstoneWireParserTest.kt +51 -0
  22. package/dist/cjs/config/getRNInstrumentations.js +3 -1
  23. package/dist/cjs/config/getRNInstrumentations.js.map +1 -1
  24. package/dist/cjs/config/makeRNConfig.js +48 -9
  25. package/dist/cjs/config/makeRNConfig.js.map +1 -1
  26. package/dist/cjs/config/types.js.map +1 -1
  27. package/dist/cjs/generated/faroRNPackageMeta.js +1 -1
  28. package/dist/cjs/generated/faroRNPackageMeta.js.map +1 -1
  29. package/dist/cjs/index.js +3 -2
  30. package/dist/cjs/index.js.map +1 -1
  31. package/dist/cjs/initialize.js +14 -8
  32. package/dist/cjs/initialize.js.map +1 -1
  33. package/dist/cjs/instrumentations/anr/anrStack.js +19 -0
  34. package/dist/cjs/instrumentations/anr/anrStack.js.map +1 -0
  35. package/dist/cjs/instrumentations/anr/instrumentation.js +374 -72
  36. package/dist/cjs/instrumentations/anr/instrumentation.js.map +1 -1
  37. package/dist/cjs/instrumentations/anr/types.js.map +1 -1
  38. package/dist/cjs/instrumentations/console/index.js +5 -1
  39. package/dist/cjs/instrumentations/console/index.js.map +1 -1
  40. package/dist/cjs/instrumentations/crashReporting/{instrumentation.js → BaseCrashReportingInstrumentation.js} +110 -103
  41. package/dist/cjs/instrumentations/crashReporting/BaseCrashReportingInstrumentation.js.map +1 -0
  42. package/dist/cjs/instrumentations/crashReporting/NoOpCrashReportingInstrumentation.js +41 -0
  43. package/dist/cjs/instrumentations/crashReporting/NoOpCrashReportingInstrumentation.js.map +1 -0
  44. package/dist/cjs/instrumentations/crashReporting/android/AndroidCrashReportingInstrumentation.js +87 -0
  45. package/dist/cjs/instrumentations/crashReporting/android/AndroidCrashReportingInstrumentation.js.map +1 -0
  46. package/dist/cjs/instrumentations/crashReporting/android/crashErrorMessage.js +123 -0
  47. package/dist/cjs/instrumentations/crashReporting/android/crashErrorMessage.js.map +1 -0
  48. package/dist/cjs/instrumentations/crashReporting/android/index.js +12 -0
  49. package/dist/cjs/instrumentations/crashReporting/android/index.js.map +1 -0
  50. package/dist/cjs/instrumentations/crashReporting/android/nativeTombstoneTrace.js +11 -0
  51. package/dist/cjs/instrumentations/crashReporting/android/nativeTombstoneTrace.js.map +1 -0
  52. package/dist/cjs/instrumentations/crashReporting/android/parseAndroidCrashTrace.js +181 -0
  53. package/dist/cjs/instrumentations/crashReporting/android/parseAndroidCrashTrace.js.map +1 -0
  54. package/dist/cjs/instrumentations/crashReporting/index.js +35 -2
  55. package/dist/cjs/instrumentations/crashReporting/index.js.map +1 -1
  56. package/dist/cjs/instrumentations/crashReporting/ios/IosCrashReportingInstrumentation.js +78 -0
  57. package/dist/cjs/instrumentations/crashReporting/ios/IosCrashReportingInstrumentation.js.map +1 -0
  58. package/dist/cjs/instrumentations/crashReporting/ios/crashErrorMessage.js +103 -0
  59. package/dist/cjs/instrumentations/crashReporting/ios/crashErrorMessage.js.map +1 -0
  60. package/dist/cjs/instrumentations/crashReporting/ios/index.js +11 -0
  61. package/dist/cjs/instrumentations/crashReporting/ios/index.js.map +1 -0
  62. package/dist/cjs/instrumentations/crashReporting/ios/parseIosCrashTrace.js +48 -0
  63. package/dist/cjs/instrumentations/crashReporting/ios/parseIosCrashTrace.js.map +1 -0
  64. package/dist/cjs/instrumentations/crashReporting/types.js.map +1 -1
  65. package/dist/cjs/instrumentations/errors/index.js +2 -1
  66. package/dist/cjs/instrumentations/errors/index.js.map +1 -1
  67. package/dist/cjs/instrumentations/session/installationId.js +91 -0
  68. package/dist/cjs/instrumentations/session/installationId.js.map +1 -0
  69. package/dist/cjs/instrumentations/session/sessionAttributes.js +152 -89
  70. package/dist/cjs/instrumentations/session/sessionAttributes.js.map +1 -1
  71. package/dist/cjs/metas/appBuildIdentity.js +95 -0
  72. package/dist/cjs/metas/appBuildIdentity.js.map +1 -0
  73. package/dist/cjs/testUtils/mockDeviceInfo.js +5 -0
  74. package/dist/cjs/testUtils/mockDeviceInfo.js.map +1 -1
  75. package/dist/cjs/testUtils/setupTests.js +7 -0
  76. package/dist/cjs/testUtils/setupTests.js.map +1 -1
  77. package/dist/esm/config/getRNInstrumentations.js +3 -1
  78. package/dist/esm/config/getRNInstrumentations.js.map +1 -1
  79. package/dist/esm/config/makeRNConfig.js +49 -10
  80. package/dist/esm/config/makeRNConfig.js.map +1 -1
  81. package/dist/esm/config/types.js.map +1 -1
  82. package/dist/esm/generated/faroRNPackageMeta.js +1 -1
  83. package/dist/esm/generated/faroRNPackageMeta.js.map +1 -1
  84. package/dist/esm/index.js +1 -1
  85. package/dist/esm/index.js.map +1 -1
  86. package/dist/esm/initialize.js +11 -5
  87. package/dist/esm/initialize.js.map +1 -1
  88. package/dist/esm/instrumentations/anr/anrStack.js +16 -0
  89. package/dist/esm/instrumentations/anr/anrStack.js.map +1 -0
  90. package/dist/esm/instrumentations/anr/instrumentation.js +260 -67
  91. package/dist/esm/instrumentations/anr/instrumentation.js.map +1 -1
  92. package/dist/esm/instrumentations/anr/types.js.map +1 -1
  93. package/dist/esm/instrumentations/console/index.js +5 -1
  94. package/dist/esm/instrumentations/console/index.js.map +1 -1
  95. package/dist/esm/instrumentations/crashReporting/{instrumentation.js → BaseCrashReportingInstrumentation.js} +76 -94
  96. package/dist/esm/instrumentations/crashReporting/BaseCrashReportingInstrumentation.js.map +1 -0
  97. package/dist/esm/instrumentations/crashReporting/NoOpCrashReportingInstrumentation.js +18 -0
  98. package/dist/esm/instrumentations/crashReporting/NoOpCrashReportingInstrumentation.js.map +1 -0
  99. package/dist/esm/instrumentations/crashReporting/android/AndroidCrashReportingInstrumentation.js +56 -0
  100. package/dist/esm/instrumentations/crashReporting/android/AndroidCrashReportingInstrumentation.js.map +1 -0
  101. package/dist/esm/instrumentations/crashReporting/android/crashErrorMessage.js +116 -0
  102. package/dist/esm/instrumentations/crashReporting/android/crashErrorMessage.js.map +1 -0
  103. package/dist/esm/instrumentations/crashReporting/android/index.js +4 -0
  104. package/dist/esm/instrumentations/crashReporting/android/index.js.map +1 -0
  105. package/dist/esm/instrumentations/crashReporting/android/nativeTombstoneTrace.js +8 -0
  106. package/dist/esm/instrumentations/crashReporting/android/nativeTombstoneTrace.js.map +1 -0
  107. package/dist/esm/instrumentations/crashReporting/android/parseAndroidCrashTrace.js +174 -0
  108. package/dist/esm/instrumentations/crashReporting/android/parseAndroidCrashTrace.js.map +1 -0
  109. package/dist/esm/instrumentations/crashReporting/index.js +35 -1
  110. package/dist/esm/instrumentations/crashReporting/index.js.map +1 -1
  111. package/dist/esm/instrumentations/crashReporting/ios/IosCrashReportingInstrumentation.js +56 -0
  112. package/dist/esm/instrumentations/crashReporting/ios/IosCrashReportingInstrumentation.js.map +1 -0
  113. package/dist/esm/instrumentations/crashReporting/ios/crashErrorMessage.js +98 -0
  114. package/dist/esm/instrumentations/crashReporting/ios/crashErrorMessage.js.map +1 -0
  115. package/dist/esm/instrumentations/crashReporting/ios/index.js +4 -0
  116. package/dist/esm/instrumentations/crashReporting/ios/index.js.map +1 -0
  117. package/dist/esm/instrumentations/crashReporting/ios/parseIosCrashTrace.js +44 -0
  118. package/dist/esm/instrumentations/crashReporting/ios/parseIosCrashTrace.js.map +1 -0
  119. package/dist/esm/instrumentations/crashReporting/types.js.map +1 -1
  120. package/dist/esm/instrumentations/errors/index.js +2 -1
  121. package/dist/esm/instrumentations/errors/index.js.map +1 -1
  122. package/dist/esm/instrumentations/session/installationId.js +48 -0
  123. package/dist/esm/instrumentations/session/installationId.js.map +1 -0
  124. package/dist/esm/instrumentations/session/sessionAttributes.js +83 -38
  125. package/dist/esm/instrumentations/session/sessionAttributes.js.map +1 -1
  126. package/dist/esm/metas/appBuildIdentity.js +56 -0
  127. package/dist/esm/metas/appBuildIdentity.js.map +1 -0
  128. package/dist/esm/testUtils/mockDeviceInfo.js +5 -0
  129. package/dist/esm/testUtils/mockDeviceInfo.js.map +1 -1
  130. package/dist/esm/testUtils/setupTests.js +7 -0
  131. package/dist/esm/testUtils/setupTests.js.map +1 -1
  132. package/dist/types/config/makeRNConfig.d.ts +4 -3
  133. package/dist/types/config/types.d.ts +2 -1
  134. package/dist/types/generated/faroRNPackageMeta.d.ts +1 -1
  135. package/dist/types/index.d.ts +2 -2
  136. package/dist/types/initialize.d.ts +4 -2
  137. package/dist/types/instrumentations/anr/anrStack.d.ts +7 -0
  138. package/dist/types/instrumentations/anr/instrumentation.d.ts +23 -28
  139. package/dist/types/instrumentations/anr/types.d.ts +5 -1
  140. package/dist/types/instrumentations/appState/index.d.ts +1 -1
  141. package/dist/types/instrumentations/console/index.d.ts +1 -1
  142. package/dist/types/instrumentations/crashReporting/BaseCrashReportingInstrumentation.d.ts +56 -0
  143. package/dist/types/instrumentations/crashReporting/NoOpCrashReportingInstrumentation.d.ts +12 -0
  144. package/dist/types/instrumentations/crashReporting/android/AndroidCrashReportingInstrumentation.d.ts +26 -0
  145. package/dist/types/instrumentations/crashReporting/android/crashErrorMessage.d.ts +23 -0
  146. package/dist/types/instrumentations/crashReporting/android/index.d.ts +4 -0
  147. package/dist/types/instrumentations/crashReporting/android/nativeTombstoneTrace.d.ts +2 -0
  148. package/dist/types/instrumentations/crashReporting/android/parseAndroidCrashTrace.d.ts +45 -0
  149. package/dist/types/instrumentations/crashReporting/index.d.ts +25 -2
  150. package/dist/types/instrumentations/crashReporting/ios/IosCrashReportingInstrumentation.d.ts +28 -0
  151. package/dist/types/instrumentations/crashReporting/ios/crashErrorMessage.d.ts +14 -0
  152. package/dist/types/instrumentations/crashReporting/ios/index.d.ts +4 -0
  153. package/dist/types/instrumentations/crashReporting/ios/parseIosCrashTrace.d.ts +38 -0
  154. package/dist/types/instrumentations/crashReporting/types.d.ts +18 -51
  155. package/dist/types/instrumentations/frameMonitoring/instrumentation.d.ts +1 -1
  156. package/dist/types/instrumentations/http/index.d.ts +1 -1
  157. package/dist/types/instrumentations/performance/index.d.ts +1 -1
  158. package/dist/types/instrumentations/session/index.d.ts +1 -1
  159. package/dist/types/instrumentations/session/installationId.d.ts +1 -0
  160. package/dist/types/instrumentations/session/sessionAttributes.d.ts +13 -4
  161. package/dist/types/instrumentations/startup/index.d.ts +1 -1
  162. package/dist/types/instrumentations/userActions/index.d.ts +1 -1
  163. package/dist/types/instrumentations/view/index.d.ts +1 -1
  164. package/dist/types/instrumentations/xhr/index.d.ts +1 -1
  165. package/dist/types/metas/appBuildIdentity.d.ts +16 -0
  166. package/dist/types/testUtils/mockFaroReactNativeTracing.d.ts +1 -1
  167. package/dist/types/transports/console/transport.d.ts +1 -1
  168. package/dist/types/transports/fetch/transport.d.ts +1 -1
  169. package/dist/types/transports/offline/transport.d.ts +1 -1
  170. package/package.json +3 -3
  171. package/src/config/getRNInstrumentations.ts +5 -1
  172. package/src/config/makeRNConfig.test.ts +59 -3
  173. package/src/config/makeRNConfig.ts +48 -9
  174. package/src/config/types.ts +2 -1
  175. package/src/generated/faroRNPackageMeta.ts +1 -1
  176. package/src/index.ts +2 -1
  177. package/src/initialize.test.ts +71 -15
  178. package/src/initialize.ts +11 -5
  179. package/src/instrumentations/anr/anrStack.test.ts +27 -0
  180. package/src/instrumentations/anr/anrStack.ts +19 -0
  181. package/src/instrumentations/anr/instrumentation.test.ts +45 -0
  182. package/src/instrumentations/anr/instrumentation.ts +301 -67
  183. package/src/instrumentations/anr/types.ts +7 -1
  184. package/src/instrumentations/console/index.ts +5 -1
  185. package/src/instrumentations/console/instrumentation.test.ts +5 -0
  186. package/src/instrumentations/crashReporting/{instrumentation.ts → BaseCrashReportingInstrumentation.ts} +119 -93
  187. package/src/instrumentations/crashReporting/NoOpCrashReportingInstrumentation.ts +23 -0
  188. package/src/instrumentations/crashReporting/android/AndroidCrashReportingInstrumentation.ts +62 -0
  189. package/src/instrumentations/crashReporting/android/crashErrorMessage.test.ts +182 -0
  190. package/src/instrumentations/crashReporting/android/crashErrorMessage.ts +135 -0
  191. package/src/instrumentations/crashReporting/android/index.ts +4 -0
  192. package/src/instrumentations/crashReporting/android/nativeTombstoneTrace.test.ts +19 -0
  193. package/src/instrumentations/crashReporting/android/nativeTombstoneTrace.ts +8 -0
  194. package/src/instrumentations/crashReporting/android/parseAndroidCrashTrace.test.ts +232 -0
  195. package/src/instrumentations/crashReporting/android/parseAndroidCrashTrace.ts +235 -0
  196. package/src/instrumentations/crashReporting/index.ts +43 -2
  197. package/src/instrumentations/crashReporting/instrumentation.test.ts +42 -0
  198. package/src/instrumentations/crashReporting/ios/IosCrashReportingInstrumentation.ts +62 -0
  199. package/src/instrumentations/crashReporting/ios/crashErrorMessage.test.ts +170 -0
  200. package/src/instrumentations/crashReporting/ios/crashErrorMessage.ts +111 -0
  201. package/src/instrumentations/crashReporting/ios/index.ts +4 -0
  202. package/src/instrumentations/crashReporting/ios/parseIosCrashTrace.test.ts +86 -0
  203. package/src/instrumentations/crashReporting/ios/parseIosCrashTrace.ts +83 -0
  204. package/src/instrumentations/crashReporting/types.ts +19 -58
  205. package/src/instrumentations/errors/index.ts +2 -1
  206. package/src/instrumentations/errors/instrumentation.test.ts +8 -2
  207. package/src/instrumentations/errors/stackTraceParser.test.ts +1 -1
  208. package/src/instrumentations/session/installationId.ts +43 -0
  209. package/src/instrumentations/session/sessionAttributes.test.ts +260 -30
  210. package/src/instrumentations/session/sessionAttributes.ts +112 -22
  211. package/src/metas/appBuildIdentity.test.ts +48 -0
  212. package/src/metas/appBuildIdentity.ts +50 -0
  213. package/src/testUtils/mockDeviceInfo.ts +5 -0
  214. package/src/testUtils/setupTests.ts +7 -0
  215. package/dist/cjs/instrumentations/crashReporting/instrumentation.js.map +0 -1
  216. package/dist/esm/instrumentations/crashReporting/instrumentation.js.map +0 -1
  217. package/dist/types/instrumentations/crashReporting/instrumentation.d.ts +0 -58
@@ -3,44 +3,39 @@ import type { ANRInstrumentationOptions } from './types';
3
3
  /**
4
4
  * ANR (Application Not Responding) Detection Instrumentation.
5
5
  *
6
- * Detects when the main/UI thread is blocked for extended periods on Android.
7
- * Uses a background thread that posts tasks to the main thread and monitors
8
- * if they complete within the timeout.
6
+ * On Android 11+, historical ANRs are read from ApplicationExitInfo (Sentry AnrV2
7
+ * style) on the next launch. ANRTracker remains a pre-API-30 fallback and a
8
+ * persistence backup when the OS trace stream is empty.
9
9
  *
10
- * **Note**: ANR detection is only available on Android. iOS does not have
11
- * the same ANR concept as Android's system watchdog.
12
- *
13
- * Sends telemetry via Faro API:
14
- * - Measurement: `anr` with `anr_count` value (for dashboards)
15
- * - Error: Each ANR with `type: 'ANR'`, stack trace, duration, timestamp (Sentry-aligned)
16
- *
17
- * @example
18
- * ```typescript
19
- * import { initializeFaro, ANRInstrumentation } from '@grafana/faro-react-native';
20
- *
21
- * initializeFaro({
22
- * url: 'https://collector.example.com',
23
- * instrumentations: [
24
- * new ANRInstrumentation({
25
- * timeout: 5000, // 5 second threshold
26
- * pollingInterval: 60000, // Poll every 60 seconds
27
- * }),
28
- * ],
29
- * });
30
- * ```
10
+ * ANRs stay out of CrashReportingInstrumentation so they are not replayed as
11
+ * generic previous-session `crash` rows with empty messages.
31
12
  */
32
13
  export declare class ANRInstrumentation extends BaseInstrumentation {
33
14
  readonly name = "@grafana/faro-react-native:instrumentation-anr";
34
- readonly version = "2.3.1";
15
+ readonly version = "2.7.0";
35
16
  private readonly options;
36
17
  private pollingIntervalId;
18
+ private anrEventSubscription;
19
+ private readonly reportedAnrTimestamps;
20
+ private readonly preferAppExitInfoAnr;
37
21
  constructor(options?: ANRInstrumentationOptions);
38
22
  initialize(): void;
39
23
  private getNativeModule;
40
24
  private startNativeTracking;
25
+ private drainAllAnrSources;
26
+ private drainHistoricalAnrs;
27
+ private drainPendingANRs;
28
+ private handleLiveAnrEvent;
29
+ private fetchPendingANRs;
30
+ private acknowledgeANRs;
31
+ private acknowledgeNearbyPendingAnrs;
32
+ private reportAndAcknowledgePendingANRs;
33
+ private shouldReportTrackerAnr;
34
+ private reportANRIfNew;
35
+ private rememberReportedTimestamp;
36
+ private isNearbyReportedTimestamp;
37
+ private isNearbyTimestamp;
38
+ private reportANR;
41
39
  private checkANRStatus;
42
- /**
43
- * Clean up resources when instrumentation is disabled.
44
- */
45
40
  unpatch(): void;
46
41
  }
@@ -10,7 +10,7 @@ export interface ANRInstrumentationOptions {
10
10
  timeout?: number;
11
11
  /**
12
12
  * Interval in milliseconds for polling ANR status from native.
13
- * Default: 60000 (60 seconds, matching Flutter SDK's default)
13
+ * Default: 10000 (10 seconds). Native also emits onANRDetected immediately.
14
14
  */
15
15
  pollingInterval?: number;
16
16
  }
@@ -34,4 +34,8 @@ export interface ANREvent {
34
34
  * Duration of the ANR in milliseconds
35
35
  */
36
36
  duration: number;
37
+ /** Human-readable ANR description from ApplicationExitInfo when available. */
38
+ description?: string;
39
+ /** `AppExitInfo` (preferred) or `ANRTracker` (fallback). */
40
+ source?: string;
37
41
  }
@@ -10,7 +10,7 @@ export declare const EVENT_APP_STATE_CHANGED = "app_lifecycle_changed";
10
10
  */
11
11
  export declare class AppStateInstrumentation extends BaseInstrumentation {
12
12
  readonly name = "@grafana/faro-react-native:instrumentation-appstate";
13
- readonly version = "2.3.1";
13
+ readonly version = "2.7.0";
14
14
  private currentState;
15
15
  private stateStartTime;
16
16
  private appStateSubscription;
@@ -11,7 +11,7 @@ import { BaseInstrumentation, LogLevel } from '@grafana/faro-core';
11
11
  */
12
12
  export declare class ConsoleInstrumentation extends BaseInstrumentation {
13
13
  readonly name = "@grafana/faro-react-native:instrumentation-console";
14
- readonly version = "2.3.1";
14
+ readonly version = "2.7.0";
15
15
  static defaultDisabledLevels: LogLevel[];
16
16
  static consoleErrorPrefix: string;
17
17
  private originalConsole;
@@ -0,0 +1,56 @@
1
+ import { BaseInstrumentation } from '@grafana/faro-core';
2
+ import type { CrashReport, CrashReportingOptions } from './types';
3
+ /**
4
+ * Abstract base class for platform-specific crash reporting implementations.
5
+ *
6
+ * Defines the common contract that both Android and iOS implementations must follow.
7
+ * Handles the shared logic for retrieving crash reports from native modules and
8
+ * processing them, while delegating platform-specific parsing and validation to subclasses.
9
+ */
10
+ export declare abstract class BaseCrashReportingInstrumentation extends BaseInstrumentation {
11
+ abstract readonly name: string;
12
+ abstract readonly version: string;
13
+ protected readonly options: {
14
+ enabled: boolean;
15
+ releaseBundleFilename?: string;
16
+ };
17
+ constructor(options?: CrashReportingOptions);
18
+ initialize(): Promise<void>;
19
+ /**
20
+ * Platform-specific: Parse a crash trace string into structured stack frames.
21
+ */
22
+ protected abstract parseCrashTrace(trace: string): any | null;
23
+ /**
24
+ * Platform-specific: Resolve human-readable error message from crash data.
25
+ */
26
+ protected abstract resolveCrashErrorMessage(crash: CrashReport, parsedTrace: any | null): string;
27
+ /**
28
+ * Platform-specific: Determine if a crash report should be skipped.
29
+ */
30
+ protected abstract shouldSkipCrashReport(crash: CrashReport): boolean;
31
+ /**
32
+ * Platform-specific: Extract stack frames from parsed trace.
33
+ */
34
+ protected abstract getStackFrames(parsedTrace: any | null): any[];
35
+ /**
36
+ * Platform-specific: Build platform-specific context from parsed trace.
37
+ */
38
+ protected abstract buildPlatformContext(parsedTrace: any | null, context: Record<string, string>): void;
39
+ /**
40
+ * Platform-specific: Get warning message when trace parsing fails.
41
+ */
42
+ protected abstract getParseFailureWarning(): string;
43
+ /**
44
+ * Platform-specific: Get warning message when trace is unavailable.
45
+ */
46
+ protected abstract getTraceUnavailableWarning(): string;
47
+ private waitForSessionAttributes;
48
+ private getNativeModule;
49
+ private processCrashReports;
50
+ private sendCrashReport;
51
+ logDebug(message: string, ...args: any[]): void;
52
+ logInfo(message: string, ...args: any[]): void;
53
+ logWarn(message: string, ...args: any[]): void;
54
+ logError(message: string, ...args: any[]): void;
55
+ unpatch(): void;
56
+ }
@@ -0,0 +1,12 @@
1
+ import { BaseInstrumentation } from '@grafana/faro-core';
2
+ import type { CrashReportingOptions } from './types';
3
+ /**
4
+ * Crash reporting stub for platforms other than Android and iOS (e.g. web, macOS, Windows).
5
+ */
6
+ export declare class NoOpCrashReportingInstrumentation extends BaseInstrumentation {
7
+ readonly name = "@grafana/faro-react-native:instrumentation-crash-noop";
8
+ readonly version = "2.7.0";
9
+ constructor(_options?: CrashReportingOptions);
10
+ initialize(): void;
11
+ unpatch(): void;
12
+ }
@@ -0,0 +1,26 @@
1
+ import { BaseCrashReportingInstrumentation } from '../BaseCrashReportingInstrumentation';
2
+ import type { CrashReport } from '../types';
3
+ import { type ParsedAndroidCrashTrace } from './parseAndroidCrashTrace';
4
+ /**
5
+ * Android Crash Reporting Instrumentation.
6
+ *
7
+ * Uses ApplicationExitInfo API (Android 11+ / API 30+) to retrieve crash reports
8
+ * from previous sessions. Captures:
9
+ * - CRASH: Java/Kotlin exception crashes
10
+ * - CRASH_NATIVE: Native (NDK) crashes
11
+ * - LOW_MEMORY: App killed due to low memory
12
+ * - EXCESSIVE_RESOURCE_USAGE: App killed due to excessive resource usage
13
+ *
14
+ * ANRs are reported separately by ANRInstrumentation, not via ApplicationExitInfo replay.
15
+ */
16
+ export declare class AndroidCrashReportingInstrumentation extends BaseCrashReportingInstrumentation {
17
+ readonly name = "@grafana/faro-react-native:instrumentation-crash-android";
18
+ readonly version = "2.7.0";
19
+ protected parseCrashTrace(trace: string): ParsedAndroidCrashTrace | null;
20
+ protected resolveCrashErrorMessage(crash: CrashReport, parsedTrace: ParsedAndroidCrashTrace | null): string;
21
+ protected shouldSkipCrashReport(crash: CrashReport): boolean;
22
+ protected getStackFrames(parsedTrace: ParsedAndroidCrashTrace | null): any[];
23
+ protected buildPlatformContext(parsedTrace: ParsedAndroidCrashTrace | null, context: Record<string, string>): void;
24
+ protected getParseFailureWarning(): string;
25
+ protected getTraceUnavailableWarning(): string;
26
+ }
@@ -0,0 +1,23 @@
1
+ import type { CrashReport } from '../types';
2
+ import type { ParsedAndroidCrashTrace } from './parseAndroidCrashTrace';
3
+ /**
4
+ * Human-readable exception value for ApplicationExitInfo crash reports.
5
+ * Priority: parsed trace message → exception class → description → generic fallback.
6
+ */
7
+ export declare function resolveCrashErrorMessage(crash: CrashReport, parsedTrace: ParsedAndroidCrashTrace | null): string;
8
+ /**
9
+ * Android ANR watchdog descriptions from ApplicationExitInfo (any app).
10
+ */
11
+ export declare function isAnrTimeoutDescription(description: string | undefined): boolean;
12
+ /**
13
+ * Skip duplicate ApplicationExitInfo rows that have no stack and no useful title,
14
+ * and ANR incidents mis-tagged as previous-session crashes.
15
+ */
16
+ export declare function shouldSkipCrashReport(crash: CrashReport): boolean;
17
+ /**
18
+ * Skip duplicate ApplicationExitInfo rows that have no stack and no useful title.
19
+ * These surface in the plugin as a second generic `crash` row for a single button press.
20
+ */
21
+ export declare function shouldSkipLowSignalCrashReport(crash: CrashReport): boolean;
22
+ /** Generic fallback when the trace carries no parseable message or type. */
23
+ export declare function buildFallbackCrashMessage(crash: CrashReport): string;
@@ -0,0 +1,4 @@
1
+ export { AndroidCrashReportingInstrumentation } from './AndroidCrashReportingInstrumentation';
2
+ export { parseAndroidCrashTrace, normalizeJavaStackTraceForRetrace } from './parseAndroidCrashTrace';
3
+ export type { ParsedAndroidCrashTrace, AndroidCrashStackFrame } from './parseAndroidCrashTrace';
4
+ export { resolveCrashErrorMessage, shouldSkipCrashReport } from './crashErrorMessage';
@@ -0,0 +1,2 @@
1
+ /** Detect Android tombstone backtrace lines used for NDK native retrace. */
2
+ export declare function looksLikeNativeTombstoneTrace(trace: string | undefined): boolean;
@@ -0,0 +1,45 @@
1
+ import type { ExceptionStackFrame } from '@grafana/faro-core';
2
+ /**
3
+ * Android ApplicationExitInfo traces use Java/Kotlin stack-trace formatting.
4
+ * Faro ingest expects structured frames with `module` (obfuscated class) so the
5
+ * collector can R8-retrace them — not the JS call stack from sendCrashReport().
6
+ *
7
+ * Fatal RN JS errors also embed a short Hermes/Metro stack before native frames
8
+ * (e.g. `anonymous@1:1390953`). Those lines are parsed as JS frames (no `module`)
9
+ * so the collector can source-map them to files like DebugScreen.tsx.
10
+ */
11
+ export interface AndroidCrashStackFrame extends ExceptionStackFrame {
12
+ module: string;
13
+ }
14
+ export interface ParseAndroidCrashTraceOptions {
15
+ releaseBundleFilename?: string;
16
+ }
17
+ export interface NativeTombstoneStackFrame extends ExceptionStackFrame {
18
+ /** Unstripped .so basename (e.g. libappmodules.so) for NDK retrace on the collector. */
19
+ module: string;
20
+ }
21
+ export interface ParsedAndroidCrashTrace {
22
+ exceptionType?: string;
23
+ /** Human-readable message from the trace header (e.g. the JS error text). */
24
+ exceptionMessage?: string;
25
+ /** JS/Hermes frames from the embedded RN stack (source-map targets). */
26
+ jsFrames: ExceptionStackFrame[];
27
+ /** Native Java/Kotlin frames (Android R8 retrace targets). */
28
+ frames: AndroidCrashStackFrame[];
29
+ /** NDK tombstone #NN pc lines (server-side .so retrace targets). */
30
+ nativeFrames: NativeTombstoneStackFrame[];
31
+ }
32
+ /** Tombstone section headers and metadata must not become exception_type / nativeExceptionType. */
33
+ export declare function isTombstoneSectionLabel(value: string): boolean;
34
+ /** Reject version tokens (e.g. "18.2213") and other non-class header lines. */
35
+ export declare function isPlausibleJavaExceptionIdentifier(value: string): boolean;
36
+ /**
37
+ * Normalize raw Java thread stacks (e.g. ANRTracker) to Log.getStackTraceString shape
38
+ * so collector R8 retrace (mapping.RetraceText) can rewrite frame lines.
39
+ */
40
+ export declare function normalizeJavaStackTraceForRetrace(trace: string): string;
41
+ export declare function normalizeCrashTraceExceptionMessage(rawMessage: string | undefined): string | undefined;
42
+ /**
43
+ * Parse a raw Android crash trace into structured stack frames for pushError().
44
+ */
45
+ export declare function parseAndroidCrashTrace(trace: string, options?: ParseAndroidCrashTraceOptions): ParsedAndroidCrashTrace | null;
@@ -1,2 +1,25 @@
1
- export { CrashReportingInstrumentation } from './instrumentation';
2
- export type { CrashReport, CrashReportingOptions } from './types';
1
+ import { AndroidCrashReportingInstrumentation } from './android';
2
+ import { IosCrashReportingInstrumentation } from './ios';
3
+ import { NoOpCrashReportingInstrumentation } from './NoOpCrashReportingInstrumentation';
4
+ /**
5
+ * Platform-aware crash reporting instrumentation export.
6
+ *
7
+ * At module load time, determines the platform and exports the correct implementation:
8
+ * - Android: Uses ApplicationExitInfo API to retrieve crashes
9
+ * - iOS: Uses PLCrashReporter to retrieve crashes
10
+ * - Other: No-op stub (web, macOS, Windows, etc.)
11
+ *
12
+ * Usage:
13
+ * ```ts
14
+ * import { CrashReportingInstrumentation } from '@grafana/faro-react-native/instrumentation-crash';
15
+ *
16
+ * const faro = initializeFaro({
17
+ * // ...
18
+ * instrumentations: [
19
+ * new CrashReportingInstrumentation(),
20
+ * ],
21
+ * });
22
+ * ```
23
+ */
24
+ export declare const CrashReportingInstrumentation: typeof AndroidCrashReportingInstrumentation | typeof IosCrashReportingInstrumentation | typeof NoOpCrashReportingInstrumentation;
25
+ export type { CrashReportingOptions } from './types';
@@ -0,0 +1,28 @@
1
+ import { BaseCrashReportingInstrumentation } from '../BaseCrashReportingInstrumentation';
2
+ import type { CrashReport } from '../types';
3
+ import { type ParsedIosCrashTrace } from './parseIosCrashTrace';
4
+ /**
5
+ * iOS Crash Reporting Instrumentation.
6
+ *
7
+ * Uses PLCrashReporter to capture native crashes from previous sessions:
8
+ * - SIGSEGV: Segmentation fault / invalid memory access
9
+ * - SIGABRT: Abnormal termination (e.g., assertion failure, uncaught exception)
10
+ * - SIGBUS: Bus error / alignment/hardware error
11
+ * - SIGILL: Illegal instruction
12
+ * - SIGFPE: Floating point exception
13
+ * - SIGTRAP: Breakpoint/debugger trap
14
+ * - Mach exceptions (EXC_BAD_ACCESS, EXC_CRASH, etc.)
15
+ *
16
+ * Stack frames are symbolicated on the native side before being surfaced.
17
+ */
18
+ export declare class IosCrashReportingInstrumentation extends BaseCrashReportingInstrumentation {
19
+ readonly name = "@grafana/faro-react-native:instrumentation-crash-ios";
20
+ readonly version = "2.7.0";
21
+ protected parseCrashTrace(trace: string): ParsedIosCrashTrace | null;
22
+ protected resolveCrashErrorMessage(crash: CrashReport, parsedTrace: ParsedIosCrashTrace | null): string;
23
+ protected shouldSkipCrashReport(crash: CrashReport): boolean;
24
+ protected getStackFrames(parsedTrace: ParsedIosCrashTrace | null): any[];
25
+ protected buildPlatformContext(parsedTrace: ParsedIosCrashTrace | null, context: Record<string, string>): void;
26
+ protected getParseFailureWarning(): string;
27
+ protected getTraceUnavailableWarning(): string;
28
+ }
@@ -0,0 +1,14 @@
1
+ import type { CrashReport } from '../types';
2
+ import type { ParsedIosCrashTrace } from './parseIosCrashTrace';
3
+ /**
4
+ * Human-readable exception value for iOS PLCrashReporter crash reports.
5
+ * Priority: exception reason → signal description → signal name → fallback.
6
+ */
7
+ export declare function resolveCrashErrorMessage(crash: CrashReport, parsedTrace: ParsedIosCrashTrace | null): string;
8
+ /**
9
+ * Skip crash reports that have no useful information.
10
+ * iOS crashes should always have either a trace or a signal.
11
+ */
12
+ export declare function shouldSkipCrashReport(crash: CrashReport): boolean;
13
+ /** Generic fallback when the trace carries no parseable signal or description. */
14
+ export declare function buildFallbackCrashMessage(crash: CrashReport): string;
@@ -0,0 +1,4 @@
1
+ export { IosCrashReportingInstrumentation } from './IosCrashReportingInstrumentation';
2
+ export { parseIosCrashTrace } from './parseIosCrashTrace';
3
+ export type { ParsedIosCrashTrace, IosCrashStackFrame } from './parseIosCrashTrace';
4
+ export { resolveCrashErrorMessage, shouldSkipCrashReport } from './crashErrorMessage';
@@ -0,0 +1,38 @@
1
+ import type { ExceptionStackFrame } from '@grafana/faro-core';
2
+ /**
3
+ * iOS PLCrashReporter stack frames include library name and instruction pointers.
4
+ * Format: "0 libsystem_kernel.dylib 0x00000001a2b3c000"
5
+ */
6
+ export interface IosCrashStackFrame extends ExceptionStackFrame {
7
+ /** Library/module name (e.g., "MyApp", "UIKitCore") */
8
+ module: string;
9
+ /** Instruction pointer address (hex string) */
10
+ instructionPointer?: string;
11
+ /** Library base address (hex string) */
12
+ libraryBaseAddress?: string;
13
+ }
14
+ export interface ParseIosCrashTraceOptions {
15
+ releaseBundleFilename?: string;
16
+ }
17
+ export interface ParsedIosCrashTrace {
18
+ /** Signal name (e.g., "SIGSEGV", "SIGABRT") */
19
+ signalName?: string;
20
+ /** Human-readable signal description */
21
+ signalDescription?: string;
22
+ /** Exception name for uncaught exceptions (e.g., "NSInternalInconsistencyException") */
23
+ exceptionName?: string;
24
+ /** Exception reason/message for uncaught exceptions */
25
+ exceptionReason?: string;
26
+ /** iOS native frames (library + instruction pointer for symbolication) */
27
+ frames: IosCrashStackFrame[];
28
+ }
29
+ /**
30
+ * Parse a raw iOS crash trace from PLCrashReporter into structured stack frames.
31
+ *
32
+ * iOS crashes from PLCrashReporter come with formatted stack traces where each line
33
+ * contains: frame number, library name, and instruction pointer hex address.
34
+ *
35
+ * The collector will use the library name and instruction pointer for symbolication
36
+ * with dSYM files or Breakpad symbols.
37
+ */
38
+ export declare function parseIosCrashTrace(trace: string, _options?: ParseIosCrashTraceOptions): ParsedIosCrashTrace | null;
@@ -1,61 +1,28 @@
1
1
  /**
2
- * Configuration options for Crash Reporting instrumentation.
3
- *
4
- * **Platform Support**:
5
- * - **Android**: Uses ApplicationExitInfo API (Android 11+ / API 30+)
6
- * Captures: CRASH, CRASH_NATIVE, ANR, LOW_MEMORY, EXCESSIVE_RESOURCE_USAGE
7
- * - **iOS**: Uses PLCrashReporter (automatically included via podspec)
8
- * Captures: Signal crashes (SIGSEGV, SIGABRT, etc.) and Mach exceptions
9
- */
10
- export interface CrashReportingOptions {
11
- /**
12
- * Whether to enable crash reporting.
13
- * Default: true
14
- */
15
- enabled?: boolean;
16
- }
17
- /**
18
- * Crash report data from native module.
19
- *
20
- * Field names match Faro Flutter SDK for consistency across mobile platforms.
21
- * Both Android (ApplicationExitInfo) and iOS (PLCrashReporter) produce JSON
22
- * matching this interface.
2
+ * Crash report data structure returned from native module.
23
3
  */
24
4
  export interface CrashReport {
25
- /**
26
- * Reason for the crash (e.g., "CRASH", "CRASH_NATIVE", "ANR", "LOW_MEMORY")
27
- */
28
- reason: string;
29
- /**
30
- * Timestamp when the crash occurred (milliseconds since epoch)
31
- */
32
- timestamp: number;
33
- /**
34
- * Exit status code
35
- */
36
- status?: number;
37
- /**
38
- * Description of the crash
39
- */
5
+ trace?: string;
6
+ signal?: string;
7
+ timestamp?: number;
40
8
  description?: string;
41
- /**
42
- * Process importance level
43
- */
44
- importance?: number;
45
- /**
46
- * Process ID
47
- */
48
- pid?: number;
49
- /**
50
- * Process name
51
- */
52
9
  processName?: string;
10
+ pid?: number;
11
+ importance?: number;
12
+ reason?: string;
13
+ status?: number;
14
+ }
15
+ /**
16
+ * Configuration options for crash reporting instrumentation.
17
+ */
18
+ export interface CrashReportingOptions {
53
19
  /**
54
- * Stack trace (if available)
20
+ * Enable or disable crash reporting. Defaults to true.
55
21
  */
56
- trace?: string;
22
+ enabled?: boolean;
57
23
  /**
58
- * Signal name (for iOS crashes)
24
+ * Optional release bundle filename hint for R8 retracing.
25
+ * e.g., "index.android.bundle"
59
26
  */
60
- signal?: string;
27
+ releaseBundleFilename?: string;
61
28
  }
@@ -40,7 +40,7 @@ import type { FrameMonitoringOptions } from './types';
40
40
  */
41
41
  export declare class FrameMonitoringInstrumentation extends BaseInstrumentation {
42
42
  readonly name = "@grafana/faro-react-native:instrumentation-frame-monitoring";
43
- readonly version = "2.3.1";
43
+ readonly version = "2.7.0";
44
44
  private readonly options;
45
45
  private pollingIntervalId;
46
46
  private eventEmitter;
@@ -29,7 +29,7 @@ export type { HttpRequestPayload } from './utils';
29
29
  */
30
30
  export declare class HttpInstrumentation extends BaseInstrumentation {
31
31
  readonly name = "@grafana/faro-react-native:instrumentation-http";
32
- readonly version = "2.3.1";
32
+ readonly version = "2.7.0";
33
33
  private originalFetch?;
34
34
  private ignoredUrls;
35
35
  private requests;
@@ -43,7 +43,7 @@ import type { PerformanceInstrumentationOptions } from './types';
43
43
  */
44
44
  export declare class PerformanceInstrumentation extends BaseInstrumentation {
45
45
  readonly name = "@grafana/faro-react-native:instrumentation-performance";
46
- readonly version = "2.3.1";
46
+ readonly version = "2.7.0";
47
47
  private options;
48
48
  private intervalId;
49
49
  constructor(options?: PerformanceInstrumentationOptions);
@@ -5,7 +5,7 @@ import { BaseInstrumentation } from '@grafana/faro-core';
5
5
  */
6
6
  export declare class SessionInstrumentation extends BaseInstrumentation {
7
7
  readonly name = "@grafana/faro-react-native:instrumentation-session";
8
- readonly version = "2.3.1";
8
+ readonly version = "2.7.0";
9
9
  private notifiedSession;
10
10
  private sessionManagerInstance;
11
11
  private getDefaultSessionDeviceAttributes;
@@ -0,0 +1 @@
1
+ export declare function getInstallationId(): Promise<string | undefined>;
@@ -1,3 +1,4 @@
1
+ import type { Meta } from '@grafana/faro-core';
1
2
  /**
2
3
  * Session attributes for React Native
3
4
  * These attributes are automatically included with every telemetry event
@@ -18,17 +19,17 @@ export interface SessionAttributes {
18
19
  device_os_version?: string;
19
20
  /** Detailed OS info (e.g., "iOS 17.0" or "Android 15 (SDK 35)") */
20
21
  device_os_detail?: string;
21
- /** Device manufacturer (e.g., "apple", "samsung") */
22
+ /** Device manufacturer (e.g., "apple", "samsung", "Google") */
22
23
  device_manufacturer?: string;
23
- /** Raw model identifier (e.g., "iPhone16,1", "SM-A155F") */
24
+ /** Device model in flat session attributes (e.g., "iPhone 15 Pro", "SM-A155F") */
24
25
  device_model?: string;
25
26
  /** Human-readable model name (e.g., "iPhone 15 Pro") */
26
27
  device_model_name?: string;
27
- /** Device brand (e.g., "iPhone", "samsung") */
28
+ /** Device brand in flat session attributes (e.g., "Apple", "samsung") */
28
29
  device_brand?: string;
29
30
  /** Whether device is physical or emulator ("true" or "false") */
30
31
  device_is_physical?: string;
31
- /** Unique device ID (UUID) */
32
+ /** Temporary flat attribute mirroring `app.installationId` during migration. */
32
33
  device_id?: string;
33
34
  /** Device type ("mobile" or "tablet") */
34
35
  device_type?: string;
@@ -45,6 +46,10 @@ export interface SessionAttributes {
45
46
  /** Mobile carrier name (e.g., "Verizon") - empty if unavailable */
46
47
  device_carrier?: string;
47
48
  }
49
+ export interface PreloadedMobileMeta {
50
+ sessionAttributes: SessionAttributes;
51
+ meta: Pick<Meta, 'app' | 'device' | 'os'>;
52
+ }
48
53
  /**
49
54
  * Session attributes without device props when async collection or DeviceInfo is unavailable.
50
55
  * No synchronous DeviceInfo reads — use {@link getSessionAttributes} or the package async `initializeFaro`.
@@ -67,6 +72,10 @@ export declare function minimalSessionDeviceAttributes(): SessionAttributes;
67
72
  * - device_carrier
68
73
  */
69
74
  export declare function getSessionAttributes(): Promise<SessionAttributes>;
75
+ /**
76
+ * Get structured mobile meta plus flat session attributes for async `initializeFaro`.
77
+ */
78
+ export declare function loadMobileMetaForInit(): Promise<PreloadedMobileMeta>;
70
79
  /**
71
80
  * Await full async session device attributes (battery, carrier, etc.), then fall back to
72
81
  * {@link minimalSessionDeviceAttributes} if anything throws. Used by async `initializeFaro`.
@@ -37,7 +37,7 @@ import type { StartupInstrumentationOptions } from './types';
37
37
  export declare class StartupInstrumentation extends BaseInstrumentation {
38
38
  private options;
39
39
  readonly name = "@grafana/faro-react-native:instrumentation-startup";
40
- readonly version = "2.3.1";
40
+ readonly version = "2.7.0";
41
41
  /** 0 = came from background (warm start eligible), null = never backgrounded */
42
42
  private warmStartTimestamp;
43
43
  private appStateSubscription;
@@ -24,7 +24,7 @@ import { BaseInstrumentation } from '@grafana/faro-core';
24
24
  */
25
25
  export declare class UserActionInstrumentation extends BaseInstrumentation {
26
26
  readonly name = "@grafana/faro-react-native:instrumentation-user-action";
27
- readonly version = "2.3.1";
27
+ readonly version = "2.7.0";
28
28
  private _userActionSub?;
29
29
  initialize(): void;
30
30
  /**
@@ -9,7 +9,7 @@ import { BaseInstrumentation } from '@grafana/faro-core';
9
9
  */
10
10
  export declare class ViewInstrumentation extends BaseInstrumentation {
11
11
  readonly name = "@grafana/faro-react-native:instrumentation-view";
12
- readonly version = "2.3.1";
12
+ readonly version = "2.7.0";
13
13
  private notifiedView;
14
14
  private metaUnsubscribe;
15
15
  private sendViewChangedEvent;
@@ -7,7 +7,7 @@ import { BaseInstrumentation } from '@grafana/faro-core';
7
7
  */
8
8
  export declare class XHRInstrumentation extends BaseInstrumentation {
9
9
  readonly name = "@grafana/faro-react-native:instrumentation-xhr";
10
- readonly version = "2.3.1";
10
+ readonly version = "2.7.0";
11
11
  private originalOpen?;
12
12
  private originalSend?;
13
13
  private ignoredUrls;
@@ -0,0 +1,16 @@
1
+ /** Metro / webpack preamble bundle id for JS source maps (`__faroBundleId_<appName>`). */
2
+ export declare function getMetroInjectedBundleId(appName: string | undefined): string | undefined;
3
+ /**
4
+ * Encodes the Android/iOS build identity used as `meta.app.bundleId` for
5
+ * server-side symbol retrace. Must match the symbols upload bundle id
6
+ * (`{applicationId}@{versionCode}@{versionName}`).
7
+ */
8
+ export declare function formatSymbolsBundleId(applicationId: string, versionCode: string, versionName: string): string;
9
+ /**
10
+ * Reads the installed build's identity from `react-native-device-info` and
11
+ * returns the encoded bundle id when all parts are available.
12
+ *
13
+ * Values must match what the symbol uploader (Gradle plugin / faro-cli) sends
14
+ * for the same build so the collector can locate the mapping for retrace.
15
+ */
16
+ export declare function loadAppSymbolsBundleIdForInit(): Promise<string | undefined>;
@@ -5,6 +5,6 @@
5
5
  import { BaseInstrumentation } from '@grafana/faro-core';
6
6
  export declare class TracingInstrumentation extends BaseInstrumentation {
7
7
  readonly name = "@grafana/faro-react-native-tracing";
8
- readonly version = "2.3.1";
8
+ readonly version = "2.7.0";
9
9
  initialize(): void;
10
10
  }