Skip to main content
The HarmonyOS SDK assembles RUM data as NDJSON batches and uploads them to Flashduty. The current version collects four RUM event types: view, action, resource, and error. Crashes and hangs enter the same pipeline as error events with 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.
View events include:

Action events

An action represents user interaction. Record instantaneous actions with addAction(), or timed actions with startAction() and stopAction().
Supported action types: 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 rcp session with FlashcatTrace.interceptor()
  • You use FlashcatHttp.request() to wrap @kit.NetworkKit requests
  • You wire an axios instance up with trackAxios() from @flashcatcloud/axios
  • You wire another network stack up with FlashcatTrace.startTracedResource()
All four require setTrackNetworkRequests(true). You can also record resources manually with GlobalRumMonitor.get().startResource() and stopResource(), which the toggle does not affect.
Resource events include: 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.
Supported error sources: 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_EXIT and REPORT_AND_RECOVER synchronously persist an SDK pending crash incident before the process exits or restarts; REPORT_AND_CONTINUE reports 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 hiAppEvent replays APP_CRASH and APP_FREEZE on a later launch to capture ArkTS crashes, native C/C++ crashes, and hangs
One ArkTS crash produces exactly one crash error event, never duplicates. Unhandled Promise rejections are collected separately as ordinary, non-crashing RUM errors with 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
When replaying such a fault, the SDK writes an 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
Crash events are reported through the RUM error pipeline:
  • 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 .so files, 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