Skip to content

Commit 28dd626

Browse files
authored
Merge pull request #226 from flashcatcloud/docs/flutter-sdk-0.1.3
docs(rum): restore Flutter SDK nav and sync it to the 0.1.3 release
2 parents 9e67148 + 65b8dad commit 28dd626

7 files changed

Lines changed: 80 additions & 62 deletions

File tree

docs.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,15 @@
419419
"zh/rum/sdk/harmony/data-collection"
420420
]
421421
},
422+
{
423+
"group": "Flutter",
424+
"pages": [
425+
"zh/rum/sdk/flutter/sdk-integration",
426+
"zh/rum/sdk/flutter/advanced-config",
427+
"zh/rum/sdk/flutter/compatible",
428+
"zh/rum/sdk/flutter/data-collection"
429+
]
430+
},
422431
{
423432
"group": "微信小程序",
424433
"pages": [
@@ -1648,6 +1657,15 @@
16481657
"en/rum/sdk/harmony/data-collection"
16491658
]
16501659
},
1660+
{
1661+
"group": "Flutter",
1662+
"pages": [
1663+
"en/rum/sdk/flutter/sdk-integration",
1664+
"en/rum/sdk/flutter/advanced-config",
1665+
"en/rum/sdk/flutter/compatible",
1666+
"en/rum/sdk/flutter/data-collection"
1667+
]
1668+
},
16511669
{
16521670
"group": "WeChat Mini Program",
16531671
"pages": [

en/rum/sdk/flutter/advanced-config.mdx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,16 @@ To resolve crash and error stacks back to source locations, you need to upload s
100100
Use the FlashCat CLI to upload symbol files:
101101

102102
```bash
103-
# Example: upload the symbol files for the corresponding version
104-
flashcat-cli flutter-symbols upload --service <SERVICE_NAME> --version <VERSION> <symbols-dir>
103+
# Requires @flashcatcloud/flashcat-cli 0.2.0 or later
104+
FLASHCAT_API_KEY=<API_KEY> flashcat-cli flutter-symbols upload <symbols-dir> \
105+
--service <SERVICE_NAME> --release-version <VERSION>
105106
```
106107

107-
<Warning>
108-
The `version` and `service` used at upload time must exactly match the values in the SDK initialization. Otherwise the console can receive crash events but cannot resolve stack frames back to source locations. Make symbol upload part of your release build process.
109-
</Warning>
108+
<Note>
109+
Symbol files are matched to crash events by the build's **build ID**; `service` and `release-version` take no part in the lookup. Symbolication therefore still works when they differ from the SDK initialization values — the difference only affects how the file is grouped and filtered in the console's Source code mapping list. Keeping them aligned is still recommended, and Flutter's build-number suffix (for example `1.2.3+45`) is an easy way for them to drift apart.
110+
111+
What must match is the build ID: the `app.<platform>-<arch>.symbols` file produced by `--split-debug-info`, the `libapp.so` inside the APK, and the Build ID column in the console's Source code mapping → Flutter list must all be identical. Every change to your Dart code produces a new build ID, so **symbol upload has to be part of every release build** — otherwise that version's stacks silently degrade to unresolved.
112+
</Note>
110113

111114
## Other configuration
112115

en/rum/sdk/flutter/compatible.mdx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This page describes the Flutter SDK support scope and current limits so you can
1010

1111
| Item | Support |
1212
|------|----------|
13-
| SDK version | `flashcat_flutter_plugin` 0.1.0 |
13+
| SDK version | `flashcat_flutter_plugin` 0.1.3 |
1414
| Target platforms | **iOS and Android** (Flutter Web / Desktop not supported) |
1515
| Flutter / Dart | Flutter ≥ 3.0, Dart ≥ 3.0 |
1616
| iOS | Deployment target ≥ 12.0 |
@@ -24,11 +24,11 @@ This page describes the Flutter SDK support scope and current limits so you can
2424
| Package | pub name | Description |
2525
|------|------|------|
2626
| RUM / Core / Crash | `flashcat_flutter_plugin` | Initialization, configuration, RUM (view / action / resource / error / session), and native crash collection |
27-
| HTTP tracking | `datadog_tracking_http_client` | Automatically records `dart:io` / `http` requests as resources and injects trace headers (requires `dependency_overrides`, not v1 core) |
27+
| HTTP tracking | `flashcat_tracking_http_client` | Automatically records `dart:io` / `http` requests as resources and injects trace headers |
2828
| WebView tracking | `flashcat_webview_tracking` | Correlates RUM data inside WebViews |
2929

3030
<Note>
31-
The Dart class names still follow the upstream `Datadog*` naming; only the site enum `FlashcatSite` (`.cn` default / `.staging`) and the package name are rebranded. The `DatadogSdk`, `DatadogConfiguration`, `DatadogRumConfiguration`, `DatadogNavigationObserver`, and other classes in the documentation examples are the actual exported class names.
31+
Dart class names begin with `Datadog*`, and the site enum is `FlashcatSite` (`.cn` default / `.staging`). The `DatadogSdk`, `DatadogConfiguration`, `DatadogRumConfiguration`, `DatadogNavigationObserver`, and other classes in the documentation examples are the actual exported class names.
3232
</Note>
3333

3434
## Supported automatic collection
@@ -37,7 +37,7 @@ The Dart class names still follow the upstream `Datadog*` naming; only the site
3737
|------|----------|------|
3838
| Automatic views | Supported | Requires a `DatadogNavigationObserver` on `MaterialApp` |
3939
| Automatic actions | Supported | Requires wrapping the subtree with `RumUserActionDetector`; `trackFrustrations` is enabled by default |
40-
| Automatic resources | Supported (requires companion package) | Through `enableHttpTracking()` from `datadog_tracking_http_client` |
40+
| Automatic resources | Supported (requires companion package) | Through `enableHttpTracking()` from `flashcat_tracking_http_client` |
4141
| Unhandled exceptions | Supported | When using `DatadogSdk.runApp`, automatically takes over `FlutterError.onError` / `PlatformDispatcher.onError` |
4242
| Native crashes | Supported | Requires `nativeCrashReportEnabled: true` |
4343
| Distributed tracing | Supported | Injects W3C `traceparent` for hosts that match `firstPartyHosts` |
@@ -47,12 +47,11 @@ The Dart class names still follow the upstream `Datadog*` naming; only the site
4747
| Limit | Description |
4848
|------|------|
4949
| Platform scope | iOS / Android only; Flutter Web and Desktop are not supported |
50-
| Logs | v1 does not support log reporting (`DatadogLoggingConfiguration` is a no-op) |
51-
| Session Replay | Not supported in v1 (`datadog_session_replay` is a preview, not in the core scope) |
52-
| Companion package naming | `datadog_tracking_http_client` / `datadog_session_replay` still declare their dependency on `datadog_flutter_plugin: ^3.0.0`, so integrating this fork requires `dependency_overrides` |
53-
| dio / gql / grpc | The corresponding interceptor packages are not yet adapted to this fork in v1 |
54-
| Page performance metrics | `reportFlutterPerformance` is disabled by default; the console performance page is currently hidden for Flutter to avoid showing zero-value empty data |
55-
| pub.dev publication | Official publication is being confirmed; git dependencies are currently recommended |
50+
| Logs | Log reporting is not supported (`DatadogLoggingConfiguration` is a no-op) |
51+
| Session Replay | Not supported |
52+
| dio / gql / grpc | The corresponding interceptor packages are not supported |
53+
| Page performance metrics | `reportFlutterPerformance` is disabled by default |
54+
| Minimum version | Use `flashcat_flutter_plugin` 0.1.3 or later; on earlier versions `flutter build apk --release` fails in R8 |
5655

5756
## Symbolication compatibility
5857

@@ -70,5 +69,5 @@ Flutter crash stacks can contain both Dart frames and native (iOS / Android) fra
7069
</Warning>
7170

7271
<Tip>
73-
Symbol files are uploaded through the FlashCat CLI, and the `version` used at upload time must match the `version` in the SDK initialization. Otherwise the console can receive crash events but cannot resolve the stacks.
72+
Symbol files are uploaded through the FlashCat CLI. Symbols are matched to crash events by the build's build ID, so you need to upload a fresh set of symbol files after every code change.
7473
</Tip>

en/rum/sdk/flutter/sdk-integration.mdx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ keywords: ["RUM", "Flutter SDK", "Dart", "user monitoring", "mobile monitoring"]
77
The Flutter SDK wraps the native iOS / Android SDKs and provides RUM capabilities through `flashcat_flutter_plugin`. After initialization, the SDK reports the application's views, user actions, network requests, errors, and crashes to Flashduty RUM, with `source: "flutter"` identifying the data source.
88

99
<Info>
10-
The current SDK version is `0.1.0` and supports only the **iOS and Android** platforms (Flutter Web is not supported). The Dart class names still follow the upstream `Datadog*` naming (such as `DatadogSdk` and `DatadogConfiguration`); only the package name `flashcat_flutter_plugin` and the site enum `FlashcatSite` are rebranded. v1 does not yet include Logs, Session Replay, or the dio / gql / grpc companion packages.
10+
The current SDK version is `0.1.3` and supports the **iOS and Android** platforms (Flutter Web is not supported). Dart class names begin with `Datadog*` (such as `DatadogSdk` and `DatadogConfiguration`), and the site enum is `FlashcatSite`. Logs, Session Replay, and the dio / gql / grpc interceptor packages are not supported.
1111
</Info>
1212

1313
## Prerequisites
@@ -23,18 +23,15 @@ Before integrating the SDK, complete these steps:
2323

2424
Add `flashcat_flutter_plugin` to `pubspec.yaml`, then run `flutter pub get`.
2525

26-
<Note>
27-
The pub.dev publication of `flashcat_flutter_plugin` is still being confirmed. To keep the dependency resolvable, the example below uses a git source. Once it is officially published to pub.dev, you can switch to the hosted form `flashcat_flutter_plugin: ^0.1.0`.
28-
</Note>
29-
3026
```yaml pubspec.yaml
3127
dependencies:
32-
flashcat_flutter_plugin:
33-
git:
34-
url: https://github.com/flashcatcloud/fc-sdk-flutter
35-
path: packages/datadog_flutter_plugin
28+
flashcat_flutter_plugin: ^0.1.3
3629
```
3730
31+
<Warning>
32+
Use `0.1.3` or later. On earlier versions, `flutter build apk --release` — including the `--obfuscate` build that crash symbolication requires — fails in R8 with `Missing class org.bouncycastle.jsse.BCSSLParameters`. From `0.1.3` the required ProGuard rules ship with the package and no app-side configuration is needed.
33+
</Warning>
34+
3835
## Initialize the SDK
3936

4037
We recommend initializing in `main()`, before `runApp`. When you start the application with `DatadogSdk.runApp`, the SDK automatically takes over `FlutterError.onError` and `PlatformDispatcher.instance.onError`, so it can collect unhandled exceptions without manual wiring.
@@ -119,7 +116,12 @@ DatadogSdk.instance.rum?.addAction(RumActionType.tap, 'Checkout');
119116

120117
## Track network requests
121118

122-
Automatic network collection is provided by the separate `datadog_tracking_http_client` package and enabled through the `enableHttpTracking()` extension method on the configuration object. It globally replaces `HttpClient`, records `dart:io` / `http` requests as RUM resources, and injects W3C trace headers for hosts that match `firstPartyHosts`.
119+
Automatic network collection is provided by the separate `flashcat_tracking_http_client` package and enabled through the `enableHttpTracking()` extension method on the configuration object. It globally replaces `HttpClient`, records `dart:io` / `http` requests as RUM resources, and injects W3C trace headers for hosts that match `firstPartyHosts`.
120+
121+
```yaml pubspec.yaml
122+
dependencies:
123+
flashcat_tracking_http_client: ^0.1.0
124+
```
123125

124126
```dart
125127
final configuration = DatadogConfiguration(
@@ -131,10 +133,6 @@ final configuration = DatadogConfiguration(
131133
)..enableHttpTracking();
132134
```
133135

134-
<Warning>
135-
`datadog_tracking_http_client` currently declares its dependency on `datadog_flutter_plugin` (`^3.0.0`), which cannot be resolved directly with this fork's `flashcat_flutter_plugin` 0.1.0. When you enable network collection, add a `dependency_overrides` entry in `pubspec.yaml` pointing to this fork. This capability is not part of the v1 core scope and can be integrated as needed.
136-
</Warning>
137-
138136
## Identify users
139137

140138
After sign-in, you can set the current user. The SDK writes the user fields to the `usr` object on subsequent RUM events.
@@ -166,7 +164,7 @@ try {
166164
```
167165

168166
<Note>
169-
Crash and error stacks require uploaded symbol files to resolve back to source locations. Flutter symbols, iOS dSYM, and Android mapping files are uploaded through the FlashCat CLI, and the `version` used at upload time must match the `version` in the SDK initialization. See <a href="/en/rum/sdk/flutter/advanced-config">Advanced configuration</a>.
167+
Crash and error stacks require uploaded symbol files to resolve back to source locations. Flutter symbols, iOS dSYM, and Android mapping files are uploaded through the FlashCat CLI; every code change produces a new build, so a fresh set of symbol files has to be uploaded for it. See <a href="/en/rum/sdk/flutter/advanced-config">Advanced configuration</a>.
170168
</Note>
171169

172170
## Verify the integration

zh/rum/sdk/flutter/advanced-config.mdx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,16 @@ DatadogRumConfiguration(
100100
使用 FlashCat CLI 上传符号文件:
101101

102102
```bash
103-
# 示例:上传对应 version 的符号文件
104-
flashcat-cli flutter-symbols upload --service <SERVICE_NAME> --version <VERSION> <symbols-dir>
103+
# 需要 @flashcatcloud/flashcat-cli ≥ 0.2.0
104+
FLASHCAT_API_KEY=<API_KEY> flashcat-cli flutter-symbols upload <symbols-dir> \
105+
--service <SERVICE_NAME> --release-version <VERSION>
105106
```
106107

107-
<Warning>
108-
上传时的 `version``service` 必须与 SDK 初始化中的值完全一致,否则控制台可以收到崩溃事件,但无法把栈帧还原到源码位置。请把符号上传纳入发布构建流程。
109-
</Warning>
108+
<Note>
109+
符号文件与崩溃事件是通过构建产物的 **build ID** 关联的,`service``release-version` 不参与匹配。因此二者与 SDK 初始化值不一致时,符号解析依然正常,只影响控制台「源码映射」列表中的归类与筛选。建议仍保持一致——尤其注意 Flutter 的构建号后缀(如 `1.2.3+45`)容易造成两边不一致。
110+
111+
真正必须对上的是 build ID:`--split-debug-info` 产出的 `app.<platform>-<arch>.symbols`、APK 内 `libapp.so`、以及控制台「源码映射 → Flutter」列表中的 Build ID 三者必须相同。每次改动 Dart 代码都会生成新的 build ID,所以**符号上传必须纳入每一次发布构建**,否则该版本的堆栈会静默退化为不解析。
112+
</Note>
110113

111114
## 其他配置
112115

zh/rum/sdk/flutter/compatible.mdx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ keywords: ["RUM", "Flutter SDK", "兼容性", "Dart", "iOS", "Android"]
1010

1111
| 项目 | 支持情况 |
1212
|------|----------|
13-
| SDK 版本 | `flashcat_flutter_plugin` 0.1.0 |
13+
| SDK 版本 | `flashcat_flutter_plugin` 0.1.3 |
1414
| 目标平台 | **iOS 和 Android**(不支持 Flutter Web / Desktop) |
1515
| Flutter / Dart | Flutter ≥ 3.0,Dart ≥ 3.0 |
1616
| iOS | 部署目标 ≥ 12.0 |
@@ -24,11 +24,11 @@ keywords: ["RUM", "Flutter SDK", "兼容性", "Dart", "iOS", "Android"]
2424
|| pub 名 | 说明 |
2525
|------|------|------|
2626
| RUM / Core / Crash | `flashcat_flutter_plugin` | 初始化、配置、RUM(view / action / resource / error / session)、原生崩溃采集 |
27-
| HTTP 追踪 | `datadog_tracking_http_client` | 自动把 `dart:io` / `http` 请求记录为 resource 并注入追踪头(需 `dependency_overrides`,非 v1 核心) |
27+
| HTTP 追踪 | `flashcat_tracking_http_client` | 自动把 `dart:io` / `http` 请求记录为 resource 并注入追踪头 |
2828
| WebView 追踪 | `flashcat_webview_tracking` | 关联 WebView 内的 RUM 数据 |
2929

3030
<Note>
31-
Dart 类名仍沿用上游 `Datadog*` 命名,仅站点枚举 `FlashcatSite``.cn` 默认 / `.staging`与包名做了品牌化。文档示例中的 `DatadogSdk``DatadogConfiguration``DatadogRumConfiguration``DatadogNavigationObserver` 等均为实际导出的类名。
31+
Dart 类名以 `Datadog*` 开头,站点枚举为 `FlashcatSite``.cn` 默认 / `.staging`)。文档示例中的 `DatadogSdk``DatadogConfiguration``DatadogRumConfiguration``DatadogNavigationObserver` 等均为实际导出的类名。
3232
</Note>
3333

3434
## 支持的自动采集
@@ -37,7 +37,7 @@ Dart 类名仍沿用上游 `Datadog*` 命名,仅站点枚举 `FlashcatSite`(
3737
|------|----------|------|
3838
| 自动 view | 支持 | 需为 `MaterialApp` 添加 `DatadogNavigationObserver` |
3939
| 自动 action | 支持 | 需用 `RumUserActionDetector` 包裹子树;`trackFrustrations` 默认开启 |
40-
| 自动 resource | 支持(需伴生包) | 通过 `datadog_tracking_http_client``enableHttpTracking()` |
40+
| 自动 resource | 支持(需伴生包) | 通过 `flashcat_tracking_http_client``enableHttpTracking()` |
4141
| 未处理异常 | 支持 | 使用 `DatadogSdk.runApp` 时自动接管 `FlutterError.onError` / `PlatformDispatcher.onError` |
4242
| 原生崩溃 | 支持 |`nativeCrashReportEnabled: true` |
4343
| 分布式追踪 | 支持 |`firstPartyHosts` 命中的域名注入 W3C `traceparent` |
@@ -47,12 +47,11 @@ Dart 类名仍沿用上游 `Datadog*` 命名,仅站点枚举 `FlashcatSite`(
4747
| 限制 | 说明 |
4848
|------|------|
4949
| 平台范围 | 仅 iOS / Android;Flutter Web 与 Desktop 不支持 |
50-
| Logs | v1 不支持日志上报(`DatadogLoggingConfiguration` 为空操作) |
51-
| Session Replay | v1 不支持(`datadog_session_replay` 为 preview,不在核心范围) |
52-
| 伴生包命名 | `datadog_tracking_http_client` / `datadog_session_replay` 仍以 `datadog_flutter_plugin: ^3.0.0` 声明依赖,接入本 fork 时需 `dependency_overrides` |
53-
| dio / gql / grpc | 对应拦截包 v1 暂不适配本 fork |
54-
| 页面性能指标 | `reportFlutterPerformance` 默认关闭;控制台性能页当前对 Flutter 隐藏,避免展示无数据的零值 |
55-
| pub.dev 发布 | 正式发布确认中,当前推荐使用 git 依赖 |
50+
| Logs | 不支持日志上报(`DatadogLoggingConfiguration` 为空操作) |
51+
| Session Replay | 不支持 |
52+
| dio / gql / grpc | 对应拦截包暂不支持 |
53+
| 页面性能指标 | `reportFlutterPerformance` 默认关闭 |
54+
| 最低版本 | 请使用 `flashcat_flutter_plugin` 0.1.3 或更高版本;更低版本 `flutter build apk --release` 会失败于 R8 |
5655

5756
## 符号解析兼容性
5857

@@ -70,5 +69,5 @@ Flutter 崩溃栈可能同时包含 Dart 帧与原生(iOS / Android)帧。
7069
</Warning>
7170

7271
<Tip>
73-
符号文件通过 FlashCat CLI 上传,且上传时的 `version` 必须与 SDK 初始化中的 `version` 一致,否则控制台可以收到崩溃事件,但无法还原堆栈
72+
符号文件通过 FlashCat CLI 上传。符号与崩溃事件按构建产物的 build ID 关联,因此每次改动代码后都需要重新上传该版本的符号文件
7473
</Tip>

0 commit comments

Comments
 (0)