is_crash.
Default context
After initialization, the SDK attaches shared context to every event.clientToken is only used for report authentication and is never attached to RUM events.Session rules
The SDK manages sampling and lifecycle at the session level.View events
A view represents a page or business screen. Generate views through automatic route tracking or manual APIs.Action events
An action represents user interaction. Record instantaneous actions withaddAction(), or timed actions with startAction() and stopAction().
Action events include
action.id, action.type, action.target.name, and action.loading_time. Actions recorded through FlashcatRum.trackTap() use type tap.
Resource events
A resource represents a network request. The SDK generates resources in these cases:- You use an
rcpsession withFlashcatTrace.interceptor() - You use
FlashcatHttp.request()to wrap@kit.NetworkKitrequests - You wire an axios instance up with
trackAxios()from@flashcatcloud/axios - You wire another network stack up with
FlashcatTrace.startTracedResource()
setTrackNetworkRequests(true). You can also record resources
manually with GlobalRumMonitor.get().startResource() and stopResource(),
which the toggle does not affect.
Automatic network collection maps resource types as follows:
If the request fails, the SDK generates an error event with
source: "network" and includes method, status code, and URL in error.resource.
Error events
Errors represent manually reported errors, unhandled ArkTS exceptions, unhandled Promise rejections, network errors, crashes, or hangs.
RUM automatically listens to
errorManager.on('error') and errorManager.on('unhandledRejection'). Unhandled Promise rejections are reported as ordinary, non-crashing errors and never trigger exit or recovery policies.
Error events include:
Crashes and hangs
The Crash module collects faults through live and post-mortem paths:- Uncaught main-thread ArkTS exceptions enter the live JS crash-policy path.
REPORT_THEN_EXITandREPORT_AND_RECOVERsynchronously persist an SDK pending crash incident before the process exits or restarts;REPORT_AND_CONTINUEreports the crash into the live session, keeps the process running, and persists no pending incident - On the next launch, the Crash module replays its own pending incident into RUM, marks it as consumed, and deletes the persisted file
- HarmonyOS
hiAppEventreplaysAPP_CRASHandAPP_FREEZEon a later launch to capture ArkTS crashes, native C/C++ crashes, and hangs
error.source_type: promise. They do not terminate the process or enter the crash-policy path.
Crash attribution
Crashes and hangs are attributed to the session and view the application was actually in when the fault happened, not to the launch that replays them. The two kinds of fault are attributed from different sources:- Faults the SDK can observe in-process (uncaught main-thread ArkTS exceptions) record their RUM session and view into the pending incident before the process exits, and the next launch replays them against that record
- Faults the SDK cannot observe in-process (native signal crashes, hangs) kill the process with no chance to record anything. The SDK snapshots every view event it writes to local storage. On the next launch, it reads and then deletes the snapshot to recover the crash’s session and view
is_crash error stamped with the real fault time into the original session and increments the view’s crash and error counts by one. The replay completes only when both succeed. Otherwise it is retried on the next launch, so the original session never shows as crash-free.
The SDK falls back to reporting into the current session at the current time — preserving the real fault time in the crash.crashed_at_ms attribute — in these cases:
- The view started more than 4 hours ago (the maximum session length, so the original session is already closed)
- The fault happened more than 23 hours ago (events older than 24 hours are discarded, so a crash must be reported within a day to land in its original session)
- The crash happened before the first session was established, or no view snapshot is available locally
- ArkTS / JS stacks are parsed as V8-style frames
- Native C/C++ stacks are parsed in
#NN pc <address> <lib.so>form - If you upload
sourceMaps.map,nameCache.json, and unstripped.sofiles, the server resolves source files, function names, lines, columns, and native symbols
Upload behavior
The SDK uploads events as NDJSON batches.Currently not collected
The current HarmonyOS SDK does not automatically collect:- Session Replay
- Web Vitals or browser page performance metrics
- HarmonyOS page rendering performance metrics
- Automatic frustration events