Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions en/rum/sdk/harmony/data-collection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ Action events include `action.id`, `action.type`, `action.target.name`, and `act

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 manually call `GlobalRumMonitor.get().startResource()` and `stopResource()`
- You use an `rcp` session with `FlashcatTrace.interceptor()`, with `setTrackNetworkRequests(true)` enabled
- You use `FlashcatHttp.request()` to wrap `@kit.NetworkKit` requests, with `setTrackNetworkRequests(true)` enabled
- You manually call `GlobalRumMonitor.get().startResource()` and `stopResource()`, which the toggle does not affect

```ts
import {
Expand Down
6 changes: 5 additions & 1 deletion en/rum/sdk/harmony/sdk-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ monitor.stopAction(RumActionType.SCROLL, 'product_feed');

## Track network requests and Trace

The HarmonyOS SDK supports two network integration paths.
The HarmonyOS SDK supports two network integration paths. Both only produce resource events when RUM is configured with `setTrackNetworkRequests(true)`, which is disabled by default.

<Note>
The SDK does not automatically hook `http.createHttp()` from `@kit.NetworkKit`. Requests you send with it directly are not collected. Use one of the integration paths below, or the [manual resource API](/en/rum/sdk/harmony/data-collection#resource-events).
</Note>

### rcp interceptor

Expand Down
6 changes: 3 additions & 3 deletions zh/rum/sdk/harmony/data-collection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ Action 事件包含 `action.id`、`action.type`、`action.target.name` 和 `acti

Resource 表示网络请求。SDK 会在以下场景生成 resource:

- 使用 `rcp` session 并添加 `FlashcatTrace.interceptor()`
- 使用 `FlashcatHttp.request()` 包装 `@kit.NetworkKit` 请求
- 通过 `GlobalRumMonitor.get().startResource()` 和 `stopResource()` 手动记录
- 使用 `rcp` session 并添加 `FlashcatTrace.interceptor()`,需要启用 `setTrackNetworkRequests(true)`
- 使用 `FlashcatHttp.request()` 包装 `@kit.NetworkKit` 请求,需要启用 `setTrackNetworkRequests(true)`
- 通过 `GlobalRumMonitor.get().startResource()` 和 `stopResource()` 手动记录,不受该开关影响

```ts
import {
Expand Down
6 changes: 5 additions & 1 deletion zh/rum/sdk/harmony/sdk-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ monitor.stopAction(RumActionType.SCROLL, 'product_feed');

## 采集网络请求和 Trace

HarmonyOS SDK 提供两种网络接入方式。
HarmonyOS SDK 提供两种网络接入方式。两者都只有在 RUM 配置中启用 `setTrackNetworkRequests(true)` 后才会生成 resource 事件,该开关默认关闭。

<Note>
SDK 不会自动挂钩 `@kit.NetworkKit` 的 `http.createHttp()`。直接用它发起的请求不会被采集,请改用下面两种接入方式之一,或使用[手动 resource API](/zh/rum/sdk/harmony/data-collection#resource-事件)。
</Note>

### rcp 拦截器

Expand Down