diff --git a/.cursor/rules/cursor-rules-location.mdc b/.cursor/rules/cursor-rules-location.mdc
new file mode 100644
index 0000000..fc835d5
--- /dev/null
+++ b/.cursor/rules/cursor-rules-location.mdc
@@ -0,0 +1,78 @@
+---
+description: Cursor Rules Location and Creation
+globs:
+alwaysApply: false
+---
+
+# Cursor Rules Location
+
+Rules for placing and organizing Cursor rule files in the repository.
+
+
+name: cursor_rules_location
+description: Standards for placing Cursor rule files in the correct directory
+filters:
+ # Match any .mdc files
+ - type: file_extension
+ pattern: "\\.mdc$"
+ # Match files that look like Cursor rules
+ - type: content
+ pattern: "(?s).*?"
+ # Match file creation events
+ - type: event
+ pattern: "file_create"
+
+actions:
+ - type: reject
+ conditions:
+ - pattern: "^(?!\\.\\/\\.cursor\\/rules\\/.*\\.mdc$)"
+ message: "Cursor rule files (.mdc) must be placed in the .cursor/rules directory"
+
+ - type: suggest
+ message: |
+ When creating Cursor rules:
+
+ 1. Always place rule files in PROJECT_ROOT/.cursor/rules/:
+ ```
+ .cursor/rules/
+ ├── your-rule-name.mdc
+ ├── another-rule.mdc
+ └── ...
+ ```
+
+ 2. Follow the naming convention:
+ - Use kebab-case for filenames
+ - Always use .mdc extension
+ - Make names descriptive of the rule's purpose
+
+ 3. Directory structure:
+ ```
+ PROJECT_ROOT/
+ ├── .cursor/
+ │ └── rules/
+ │ ├── your-rule-name.mdc
+ │ └── ...
+ └── ...
+ ```
+
+ 4. Never place rule files:
+ - In the project root
+ - In subdirectories outside .cursor/rules
+ - In any other location
+
+examples:
+ - input: |
+ # Bad: Rule file in wrong location
+ rules/my-rule.mdc
+ my-rule.mdc
+ .rules/my-rule.mdc
+
+ # Good: Rule file in correct location
+ .cursor/rules/my-rule.mdc
+ output: "Correctly placed Cursor rule file"
+
+metadata:
+ priority: high
+ version: 1.0
+
+
diff --git a/.cursor/rules/faro-protocol.mdc b/.cursor/rules/faro-protocol.mdc
index 5645638..afea8b9 100644
--- a/.cursor/rules/faro-protocol.mdc
+++ b/.cursor/rules/faro-protocol.mdc
@@ -65,6 +65,6 @@ This Flutter SDK implements:
## Additional Resources
-- [Grafana Faro Documentation](https:/grafana.com/docs/grafana-cloud/faro-web-sdk)
-- [Grafana Alloy Documentation](https:/grafana.com/docs/alloy/latest)
-- [Faro Receiver Component](https:/grafana.com/docs/alloy/latest/reference/components/faro/faro.receiver)
+- [Grafana Faro Documentation](mdc:https:/grafana.com/docs/grafana-cloud/faro-web-sdk)
+- [Grafana Alloy Documentation](mdc:https:/grafana.com/docs/alloy/latest)
+- [Faro Receiver Component](mdc:https:/grafana.com/docs/alloy/latest/reference/components/faro/faro.receiver)
diff --git a/.cursor/rules/plan-it-mode.mdc b/.cursor/rules/plan-it-mode.mdc
new file mode 100644
index 0000000..be9a523
--- /dev/null
+++ b/.cursor/rules/plan-it-mode.mdc
@@ -0,0 +1,78 @@
+---
+description: A structured approach to task planning and execution for PlanIt tasks
+globs:
+alwaysApply: false
+---
+
+# This rule is automatically applied when a prompt begins with "PlanIt:"
+# and implements a structured approach to task planning and execution.
+
+prompt: |
+ IMPORTANT: When a user message starts with "PlanIt:", ALWAYS follow this exact sequence:
+
+ 0. STOP AND PLAN FIRST
+ - When you see "PlanIt:", this is a signal to STOP and PLAN before taking any action
+ - Do NOT start implementing anything until you have completed steps 1-3
+ - CRITICAL: Do NOT write ANY code until the user has explicitly approved the plan
+
+ 1. Initial Prompt Refinement:
+ - Review and analyze the initial prompt for clarity and completeness
+ - Suggest improvements if needed
+ - Seek confirmation before proceeding with any suggested revisions
+
+ 2. Thoughtful Analysis Phase:
+ Before taking any action:
+ - Analyze task requirements thoroughly
+ - Review relevant parts of the codebase
+ - Document understanding and assumptions
+ - Confirm understanding with user before proceeding
+
+ 3. Structured Planning and Progress Tracking:
+ - Create a detailed action plan in `.cursor_tasks.md` using this format:
+ ([Timestamp] should have date and time in hh:mm:ss)
+ ```markdown
+ # Task: [Task Name]
+ Created: [Timestamp]
+
+
+
+ ## Action Plan
+ - [ ] Step 1
+ - [ ] Step 2
+ - [ ] Substep 2.1
+ - [ ] Substep 2.2
+ - [ ] Step 3
+
+ ## Progress Notes
+ - [Timestamp] Started implementation of...
+ - [Timestamp] Completed step 1...
+ ```
+
+ - After creating the plan, STOP and ask the user: "Does this plan look good to you? Should I proceed with implementation?"
+ - Only proceed with implementation after explicit user approval
+ - Update the plan continuously as tasks progress
+ - Document any new steps identified during execution
+
+ 4. Continuous Learning and Adaptation:
+ - CRITICAL! If you make a misstake or get feedback, create or update cursor rules with your corrections!
+ - Document learnings and improvements
+
+ Best Practices:
+ 1. Maintain clear and specific communication
+ 2. Provide context for all decisions
+ 3. Use iterative refinement when needed
+ 4. Document all significant decisions and changes
+ 5. Keep the user informed of progress
+ 6. Seek clarification when requirements are ambiguous
+ 7. ALWAYS get user approval before starting implementation
+
+ Task Execution Flow:
+ 1. Initial prompt analysis and refinement
+ 2. Create/update `.cursor_tasks.md`
+ 3. GET USER APPROVAL OF PLAN
+ 4. Execute planned steps
+ 5. Document progress and learnings
+ 6. Update plan as needed
+ 7. Seek user feedback at key points
+
+
\ No newline at end of file
diff --git a/.cursor/rules/project-overview.mdc b/.cursor/rules/project-overview.mdc
index 89bef36..a3de602 100644
--- a/.cursor/rules/project-overview.mdc
+++ b/.cursor/rules/project-overview.mdc
@@ -14,7 +14,7 @@ This is a Flutter SDK that implements the Grafana Faro protocol for mobile obser
### Main Packages
-- **rum_sdk**: The core SDK that implements the Grafana Faro protocol and handles collecting and sending data
+- **faro**: The core SDK that implements the Grafana Faro protocol and handles collecting and sending data
### Features
@@ -49,5 +49,6 @@ The SDK is designed to be integrated into Flutter applications with minimal conf
## Project Structure
-- `packages/rum_sdk`: Core SDK implementation
+- `packages/faro`: Core SDK implementation
- `docs/`: Documentation for usage and configuration
+
diff --git a/.github/workflows/flutter_checks.yml b/.github/workflows/flutter_checks.yml
index 97e75fd..0a1e46e 100644
--- a/.github/workflows/flutter_checks.yml
+++ b/.github/workflows/flutter_checks.yml
@@ -11,15 +11,15 @@ concurrency:
cancel-in-progress: true
jobs:
- build-and-test-rum-sdk:
+ build-and-test-faro:
runs-on: ubuntu-latest
timeout-minutes: 20
- name: build & test rum_sdk
+ name: build & test faro
defaults:
run:
- working-directory: packages/rum_sdk
+ working-directory: packages/faro
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
@@ -47,10 +47,10 @@ jobs:
build-example-app:
name: build Example app
runs-on: ubuntu-latest
- needs: build-and-test-rum-sdk
+ needs: build-and-test-faro
timeout-minutes: 20
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
@@ -63,17 +63,17 @@ jobs:
channel: stable
- name: Install dependencies
- working-directory: packages/rum_sdk/example
+ working-directory: packages/faro/example
run: flutter pub get
- - name: Create api-config file (only for rum_sdk)
- working-directory: packages/rum_sdk
+ - name: Create api-config file (only for faro)
+ working-directory: packages/faro
run: scripts/create-api-config-file.sh
- name: Analyze code
- working-directory: packages/rum_sdk/example
+ working-directory: packages/faro/example
run: flutter analyze
- name: Build example app
- working-directory: packages/rum_sdk/example
+ working-directory: packages/faro/example
run: flutter build apk # Replace 'apk' with 'ios', 'web', etc., as needed
diff --git a/.gitignore b/.gitignore
index 1ee144b..96486fd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,4 +28,3 @@ migrate_working_dir/
.dart_tool/
.packages
build/
-**/example/assets/
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 3713a09..7f71ddd 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -6,7 +6,7 @@
"type": "dart",
"request": "launch",
"flutterMode": "debug",
- "cwd": "${workspaceFolder}/packages/rum_sdk/example/",
+ "cwd": "${workspaceFolder}/packages/faro/example/",
"args": [
"-t",
"lib/main.dart",
diff --git a/README.md b/README.md
index 677c5c9..a723918 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-# rum_sdk
+# faro
-* Flutter SDK for Real User Monitoring
+- Flutter SDK for Real User Monitoring
## Getting Started
diff --git a/analysis_options.yaml b/analysis_options.yaml
index 5b912e7..701a93b 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -65,7 +65,6 @@ linter:
- non_constant_identifier_names
- null_closures
- only_throw_errors
- - package_api_docs
- package_prefixed_library_names
- parameter_assignments
- prefer_adjacent_string_concatenation
diff --git a/docs/Configurations.md b/docs/Configurations.md
index bbeead3..ae6d2b3 100644
--- a/docs/Configurations.md
+++ b/docs/Configurations.md
@@ -1,21 +1,23 @@
## Configurations
### Http Tracking
-To enable tracking http requests you can override the global HttpOverrides (if you have any other overrides add them before adding RumHttpOverrides)
+
+To enable tracking http requests you can override the global HttpOverrides (if you have any other overrides add them before adding FaroHttpOverrides)
```dart
- HttpOverrides.global = RumHttpOverrides(HttpOverrides.current);
+ HttpOverrides.global = FaroHttpOverrides(HttpOverrides.current);
```
### Mobile Vitals
-Mobile Vitals such as cpu usage, memory usage & refresh rate are disabled by default.
-The interval for how often the vitals are sent can also be
+
+Mobile Vitals such as cpu usage, memory usage & refresh rate are disabled by default.
+The interval for how often the vitals are sent can also be
given (default is set to 60 seconds)
```dart
- RumFlutter().runApp(
- optionsConfiguration: RumConfig(
+ Faro().runApp(
+ optionsConfiguration: FaroConfig(
// ...
cpuUsageVitals: true,
memoryUsageVitals: true,
@@ -33,15 +35,15 @@ given (default is set to 60 seconds)
### Batching Configuration
-The RUM logs can be batched and sent to the server in a single request. The batch size and the interval for sending the batch can be configured.
+The Faro logs can be batched and sent to the server in a single request. The batch size and the interval for sending the batch can be configured.
```dart
- RumFlutter().runApp(
- optionsConfiguration: RumConfig(
+ Faro().runApp(
+ optionsConfiguration: FaroConfig(
// ...
batchConfig: BatchConfig(
payloadItemLimit: 30, // default is 30
- sendTimeout: const Duration(milliseconds: 500 ), // default is 500 milliseconds
+ sendTimeout: const Duration(milliseconds: 500 ), // default is 500 milliseconds
enabled: true, // default is true
),
@@ -54,14 +56,13 @@ The RUM logs can be batched and sent to the server in a single request. The batc
```
-
### RateLimiting Configuration
-Limit the number of concurrent requests made to the RUM server
+Limit the number of concurrent requests made to the Faro server
```dart
- RumFlutter().runApp(
- optionsConfiguration: RumConfig(
+ Faro().runApp(
+ optionsConfiguration: FaroConfig(
// ...
maxBufferLimit: 30, // default is 30
// ...
@@ -78,8 +79,8 @@ Limit the number of concurrent requests made to the RUM server
enable capturing of app crashes
```dart
- RumFlutter().runApp(
-optionsConfiguration: RumConfig(
+ Faro().runApp(
+optionsConfiguration: FaroConfig(
// ...
enableCrashReporting: false
// ...
@@ -91,92 +92,91 @@ appRunner:
```
-
-RUM Navigator Observer can be added to the list of observers to get view info and also send `view_changed` events when the route changes
+Faro Navigator Observer can be added to the list of observers to get view info and also send `view_changed` events when the route changes
```dart
return MaterialApp(
//...
- navigatorObservers: [RumNavigationObserver()],
+ navigatorObservers: [FaroNavigationObserver()],
//...
),
```
-### RUM User Interactions Widget
+### Faro User Interactions Widget
-Add the Rum User Interactions Widget at the root level to enable the tracking of user interactions (click,tap...)
+Add the Faro User Interactions Widget at the root level to enable the tracking of user interactions (click,tap...)
```dart
- RumFlutter().runApp(
- optionsConfiguration: RumConfig(
+ Faro().runApp(
+ optionsConfiguration: FaroConfig(
//...
),
appRunner: () => runApp(
- const RumUserInteractionWidget(child: MyApp())
+ const FaroUserInteractionWidget(child: MyApp())
),
);
```
-### RUM Asset Bundle
+### Faro Asset Bundle
-Add the Rum Asset Bundle to track asset load info
+Add the Faro Asset Bundle to track asset load info
```dart
//..
appRunner: () => runApp(
- DefaultAssetBundle(bundle: RumAssetBundle(), child: const RumUserInteractionWidget(child: MyApp()))
+ DefaultAssetBundle(bundle: FaroAssetBundle(), child: const FaroUserInteractionWidget(child: MyApp()))
),
//..
```
### Sending Custom Events
-
-
```dart
- RumFlutter().pushEvent(String name, {Map? attributes})
+ Faro().pushEvent(String name, {Map? attributes})
// example
- RumFlutter().pushEvent("event_name")
- RumFlutter().pushEvent("event_name", attributes:{
+ Faro().pushEvent("event_name")
+ Faro().pushEvent("event_name", attributes:{
attr1:"value"
})
```
-
### Sending Custom Logs
+
```dart
-RumFlutter().pushLog(String message, {String? level ,Map? context,Map? trace})
-//example
-RumFlutter().pushLog("log_message",level:"warn")
+Faro().pushLog(String message, {String? level ,Map? context,Map? trace})
+//example
+Faro().pushLog("log_message",level:"warn")
```
### Sending Custom Measurements
+
- values can only have numeric values
+
```dart
- RumFlutter().pushMeasurement(Map? values, String type)
- RumFlutter().pushMeasurement({attr1:13.1, attr2:12},"some_measurements")
+ Faro().pushMeasurement(Map? values, String type)
+ Faro().pushMeasurement({attr1:13.1, attr2:12},"some_measurements")
```
### Sending Custom Errors
+
```dart
- RumFlutter().pushError({required type, required value, StackTrace? stacktrace, String? context})
+ Faro().pushError({required type, required value, StackTrace? stacktrace, String? context})
```
### Capturing Event Duration
To capture the duration of an event you can use the following methods
-```dart
- RumFlutter().markEventStart(String key,String name)
- // code
- RumFlutter().markEventEnd(String key,String name, {Map? attributes})
+```dart
+ Faro().markEventStart(String key,String name)
+ // code
+ Faro().markEventEnd(String key,String name, {Map? attributes})
```
-
-
### Adding User Meta
+
```dart
- RumFlutter().setUserMeta({String? userId, String? userName, String? userEmail});
+ Faro().setUserMeta({String? userId, String? userName, String? userEmail});
// example
- RumFlutter().addUserMeta(userId:"123",userName:"user",userEmail:"jhondoes@something.com")
+ Faro().addUserMeta(userId:"123",userName:"user",userEmail:"jhondoes@something.com")
```
diff --git a/docs/Features.md b/docs/Features.md
index 7cb204f..687bbbc 100644
--- a/docs/Features.md
+++ b/docs/Features.md
@@ -1,6 +1,6 @@
-## Rum Features
+## Faro Features
-## RUM Event metadata
+## Faro Event metadata
- view info
- app info (name, version , env)
@@ -35,7 +35,7 @@
- content/type
- request/ response size
-- Rum Asset Bundle
+- Faro Asset Bundle
- asset size
- asset load time
diff --git a/docs/Getting Started.md b/docs/Getting Started.md
index a38e03d..78acd47 100644
--- a/docs/Getting Started.md
+++ b/docs/Getting Started.md
@@ -1,9 +1,9 @@
-# RUM Flutter - 0.0.1 Alpha
+# Faro Flutter SDK
## Getting Started
- Installation
-- Initialise RUM
+- Initialize Faro
### Onboarding
@@ -12,10 +12,10 @@
Add the following dependencies to your `pubspec.yaml`
```yml
-rum_sdk:
+faro:
git:
url:
- path: packages/rum_sdk
+ path: packages/faro
ref: main
```
@@ -24,17 +24,17 @@ rum_sdk:
- Set up a [Grafana Alloy](https://grafana.com/docs/alloy/latest/configure/) instance.
- Configure your instance with [app-agent-receiver](https://grafana.com/docs/alloy/latest/reference/components/faro/faro.receiver/#server-block) integration. The integration exposes an http collection endpoint.
-### Initialise RUM
+### Initialize Faro
-Add the following snippet to initialize RUM Monitoring with the default configurations
-use the faro.receiver endpoint as collectorUrl in RumConfig
+Add the following snippet to initialize Faro Monitoring with the default configurations
+use the faro.receiver endpoint as collectorUrl in FaroConfig
```dart
- HttpOverrides.global = RumHttpOverrides(HttpOverrides.current); // enable http tracking
+ HttpOverrides.global = FaroHttpOverrides(HttpOverrides.current); // enable http tracking
- RumFlutter().runApp(
- optionsConfiguration: RumConfig(
+ Faro().runApp(
+ optionsConfiguration: FaroConfig(
appName: "",
appVersion: "1.0.0",
appEnv: "Test",
@@ -42,12 +42,10 @@ use the faro.receiver endpoint as collectorUrl in RumConfig
collectorUrl: "faro receiver endpoint"
),
appRunner: () => runApp(
- RumUserInteractionWidget(child: MyApp())
+ FaroUserInteractionWidget(child: MyApp())
),
);
-
-
```
-See all [configuration](./Configurations.md) options for RUM Flutter
+See all [configuration](./Configurations.md) options for Faro Flutter
diff --git a/packages/rum_sdk/.gitignore b/packages/faro/.gitignore
similarity index 100%
rename from packages/rum_sdk/.gitignore
rename to packages/faro/.gitignore
diff --git a/packages/rum_sdk/CHANGELOG.md b/packages/faro/CHANGELOG.md
similarity index 60%
rename from packages/rum_sdk/CHANGELOG.md
rename to packages/faro/CHANGELOG.md
index f39ec37..ee900e4 100644
--- a/packages/rum_sdk/CHANGELOG.md
+++ b/packages/faro/CHANGELOG.md
@@ -1,3 +1,15 @@
+## 0.2.0
+
+- Renamed package from `rum_sdk` to `faro`
+- Renamed main API class from `RumFlutter` to `Faro`
+- Renamed all related classes with "Rum" prefix to "Faro" prefix
+- Updated all import statements to use the new package name
+- Updated documentation with new package name and examples
+
+## 0.1.2
+
+- Bug fixes and improvements
+
## 0.0.1
The following Key Metrics of Flutter Applications are Added in the Alpha Release.
diff --git a/packages/rum_sdk/LICENSE b/packages/faro/LICENSE
similarity index 100%
rename from packages/rum_sdk/LICENSE
rename to packages/faro/LICENSE
diff --git a/packages/faro/README.md b/packages/faro/README.md
new file mode 100644
index 0000000..831ef5b
--- /dev/null
+++ b/packages/faro/README.md
@@ -0,0 +1,42 @@
+# Faro Flutter SDK
+
+Grafana Faro SDK for Flutter applications - Monitor your Flutter app with ease.
+
+## Getting Started
+
+This project is a Flutter implementation of the Grafana Faro protocol for mobile observability. It allows Flutter applications to send monitoring data to Grafana Cloud, providing comprehensive insights into app performance, user interactions, errors, and more.
+
+## Features
+
+- Performance monitoring (CPU, memory, app startup time)
+- Exception and error tracking
+- User interaction tracking
+- Network request monitoring
+- Session tracking
+- Custom events and measurements
+
+## Usage
+
+```dart
+import 'package:faro/faro_sdk.dart';
+
+void main() async {
+ WidgetsFlutterBinding.ensureInitialized();
+
+ await Faro().runApp(
+ optionsConfiguration: FaroConfig(
+ appName: "my_app",
+ appVersion: "1.0.0",
+ appEnv: "production",
+ apiKey: "your-api-key",
+ collectorUrl: "your-collector-url",
+ enableCrashReporting: true,
+ ),
+ appRunner: () async {
+ runApp(MyApp());
+ }
+ );
+}
+```
+
+For more information, see the [online documentation](https://flutter.dev/docs).
diff --git a/packages/rum_sdk/analysis_options.yaml b/packages/faro/analysis_options.yaml
similarity index 100%
rename from packages/rum_sdk/analysis_options.yaml
rename to packages/faro/analysis_options.yaml
diff --git a/packages/rum_sdk/android/.gitignore b/packages/faro/android/.gitignore
similarity index 100%
rename from packages/rum_sdk/android/.gitignore
rename to packages/faro/android/.gitignore
diff --git a/packages/rum_sdk/android/build.gradle b/packages/faro/android/build.gradle
similarity index 92%
rename from packages/rum_sdk/android/build.gradle
rename to packages/faro/android/build.gradle
index 1cb8f8c..886e6d2 100644
--- a/packages/rum_sdk/android/build.gradle
+++ b/packages/faro/android/build.gradle
@@ -1,4 +1,4 @@
-group 'com.example.rum_sdk'
+group 'com.example.faro'
version '0.1.2'
buildscript {
@@ -33,7 +33,7 @@ android {
minSdkVersion 19
}
- namespace 'com.example.rum_sdk'
+ namespace 'com.example.faro'
}
dependencies {
diff --git a/packages/rum_sdk/android/gradle.properties b/packages/faro/android/gradle.properties
similarity index 100%
rename from packages/rum_sdk/android/gradle.properties
rename to packages/faro/android/gradle.properties
diff --git a/packages/rum_sdk/android/gradle/wrapper/gradle-wrapper.jar b/packages/faro/android/gradle/wrapper/gradle-wrapper.jar
similarity index 100%
rename from packages/rum_sdk/android/gradle/wrapper/gradle-wrapper.jar
rename to packages/faro/android/gradle/wrapper/gradle-wrapper.jar
diff --git a/packages/rum_sdk/android/gradle/wrapper/gradle-wrapper.properties b/packages/faro/android/gradle/wrapper/gradle-wrapper.properties
similarity index 100%
rename from packages/rum_sdk/android/gradle/wrapper/gradle-wrapper.properties
rename to packages/faro/android/gradle/wrapper/gradle-wrapper.properties
diff --git a/packages/rum_sdk/android/gradlew b/packages/faro/android/gradlew
similarity index 100%
rename from packages/rum_sdk/android/gradlew
rename to packages/faro/android/gradlew
diff --git a/packages/rum_sdk/android/gradlew.bat b/packages/faro/android/gradlew.bat
similarity index 100%
rename from packages/rum_sdk/android/gradlew.bat
rename to packages/faro/android/gradlew.bat
diff --git a/packages/faro/android/settings.gradle b/packages/faro/android/settings.gradle
new file mode 100644
index 0000000..76d5cc1
--- /dev/null
+++ b/packages/faro/android/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'faro'
diff --git a/packages/rum_sdk/android/src/main/AndroidManifest.xml b/packages/faro/android/src/main/AndroidManifest.xml
similarity index 92%
rename from packages/rum_sdk/android/src/main/AndroidManifest.xml
rename to packages/faro/android/src/main/AndroidManifest.xml
index d8b0774..92d9e46 100644
--- a/packages/rum_sdk/android/src/main/AndroidManifest.xml
+++ b/packages/faro/android/src/main/AndroidManifest.xml
@@ -1,6 +1,6 @@
+ package="com.example.faro">
diff --git a/packages/rum_sdk/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/faro/example/ios/Runner.xcworkspace/contents.xcworkspacedata
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner.xcworkspace/contents.xcworkspacedata
rename to packages/faro/example/ios/Runner.xcworkspace/contents.xcworkspacedata
diff --git a/packages/rum_sdk/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/faro/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
rename to packages/faro/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
diff --git a/packages/rum_sdk/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/faro/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
rename to packages/faro/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
diff --git a/packages/rum_sdk/example/ios/Runner/AppDelegate.swift b/packages/faro/example/ios/Runner/AppDelegate.swift
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/AppDelegate.swift
rename to packages/faro/example/ios/Runner/AppDelegate.swift
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
rename to packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/faro/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
rename to packages/faro/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/faro/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/faro/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/faro/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
rename to packages/faro/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/faro/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
rename to packages/faro/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
diff --git a/packages/rum_sdk/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/faro/example/ios/Runner/Base.lproj/LaunchScreen.storyboard
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Base.lproj/LaunchScreen.storyboard
rename to packages/faro/example/ios/Runner/Base.lproj/LaunchScreen.storyboard
diff --git a/packages/rum_sdk/example/ios/Runner/Base.lproj/Main.storyboard b/packages/faro/example/ios/Runner/Base.lproj/Main.storyboard
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Base.lproj/Main.storyboard
rename to packages/faro/example/ios/Runner/Base.lproj/Main.storyboard
diff --git a/packages/rum_sdk/example/ios/Runner/Info.plist b/packages/faro/example/ios/Runner/Info.plist
similarity index 96%
rename from packages/rum_sdk/example/ios/Runner/Info.plist
rename to packages/faro/example/ios/Runner/Info.plist
index 7020f60..108164b 100644
--- a/packages/rum_sdk/example/ios/Runner/Info.plist
+++ b/packages/faro/example/ios/Runner/Info.plist
@@ -5,7 +5,7 @@
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleDisplayName
- Rum Sdk
+ Faro Sdk
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
@@ -13,7 +13,7 @@
CFBundleInfoDictionaryVersion
6.0
CFBundleName
- rum_sdk_example
+ faro_example
CFBundlePackageType
APPL
CFBundleShortVersionString
diff --git a/packages/rum_sdk/example/ios/Runner/Runner-Bridging-Header.h b/packages/faro/example/ios/Runner/Runner-Bridging-Header.h
similarity index 100%
rename from packages/rum_sdk/example/ios/Runner/Runner-Bridging-Header.h
rename to packages/faro/example/ios/Runner/Runner-Bridging-Header.h
diff --git a/packages/rum_sdk/example/ios/RunnerTests/RunnerTests.swift b/packages/faro/example/ios/RunnerTests/RunnerTests.swift
similarity index 100%
rename from packages/rum_sdk/example/ios/RunnerTests/RunnerTests.swift
rename to packages/faro/example/ios/RunnerTests/RunnerTests.swift
diff --git a/packages/rum_sdk/example/lib/main.dart b/packages/faro/example/lib/main.dart
similarity index 88%
rename from packages/rum_sdk/example/lib/main.dart
rename to packages/faro/example/lib/main.dart
index f8be58f..fc54ef4 100644
--- a/packages/rum_sdk/example/lib/main.dart
+++ b/packages/faro/example/lib/main.dart
@@ -2,21 +2,21 @@ import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
-import 'package:rum_sdk/rum_sdk.dart';
+import 'package:faro/faro_sdk.dart';
import 'package:http/http.dart' as http;
void main() async {
WidgetsFlutterBinding.ensureInitialized();
- HttpOverrides.global = RumHttpOverrides(HttpOverrides.current);
+ HttpOverrides.global = FaroHttpOverrides(HttpOverrides.current);
const faroCollectorUrl = String.fromEnvironment('FARO_COLLECTOR_URL');
final faroApiKey = faroCollectorUrl.split('/').last;
- RumFlutter().transports.add(OfflineTransport(
+ Faro().transports.add(OfflineTransport(
maxCacheDuration: const Duration(days: 3),
));
- await RumFlutter().runApp(
- optionsConfiguration: RumConfig(
+ await Faro().runApp(
+ optionsConfiguration: FaroConfig(
appName: "example_app",
appVersion: "2.0.1",
appEnv: "Test",
@@ -32,8 +32,8 @@ void main() async {
),
appRunner: () async {
runApp(DefaultAssetBundle(
- bundle: RumAssetBundle(),
- child: const RumUserInteractionWidget(child: MyApp())));
+ bundle: FaroAssetBundle(),
+ child: const FaroUserInteractionWidget(child: MyApp())));
});
}
@@ -45,9 +45,6 @@ class MyApp extends StatefulWidget {
}
class _MyAppState extends State {
- // test
- // final _rumSdkPlugin = RumSdkPlatform.instance;
-
@override
void initState() {
super.initState();
@@ -72,7 +69,7 @@ class _MyAppState extends State {
@override
Widget build(BuildContext context) {
return MaterialApp(
- navigatorObservers: [RumNavigationObserver()],
+ navigatorObservers: [FaroNavigationObserver()],
initialRoute: '/',
routes: {
'/home': (context) => const HomePage(),
@@ -80,7 +77,7 @@ class _MyAppState extends State {
},
home: Scaffold(
appBar: AppBar(
- title: const Text('RUM Test App'),
+ title: const Text('Faro Test App'),
),
body: const HomePage()));
}
@@ -121,7 +118,7 @@ class _FeaturesPageState extends State {
@override
void initState() {
super.initState();
- RumFlutter().markEventEnd("home_event_start", "home_page_load");
+ Faro().markEventEnd("home_event_start", "home_page_load");
}
// Method to simulate an ANR by blocking the main thread
@@ -186,20 +183,20 @@ class _FeaturesPageState extends State {
ElevatedButton(
child: const Text('Custom Warn Log'),
onPressed: () {
- RumFlutter().pushLog("Custom Log", level: "warn");
+ Faro().pushLog("Custom Log", level: "warn");
},
),
ElevatedButton(
child: const Text('Custom Measurement'),
onPressed: () {
- RumFlutter()
+ Faro()
.pushMeasurement({'custom_value': 1}, "custom_measurement");
},
),
ElevatedButton(
child: const Text('Custom Event'),
onPressed: () {
- RumFlutter().pushEvent("custom_event");
+ Faro().pushEvent("custom_event");
},
),
ElevatedButton(
@@ -222,13 +219,13 @@ class _FeaturesPageState extends State {
ElevatedButton(
child: const Text('Mark Event Start'),
onPressed: () async {
- RumFlutter().markEventStart("event1", "event1_duration");
+ Faro().markEventStart("event1", "event1_duration");
},
),
ElevatedButton(
child: const Text('Mark Event End'),
onPressed: () async {
- RumFlutter().markEventEnd("event1", "event1_duration");
+ Faro().markEventEnd("event1", "event1_duration");
},
),
ElevatedButton(
diff --git a/packages/rum_sdk/example/pubspec.lock b/packages/faro/example/pubspec.lock
similarity index 99%
rename from packages/rum_sdk/example/pubspec.lock
rename to packages/faro/example/pubspec.lock
index 0c0204b..f6f194a 100644
--- a/packages/rum_sdk/example/pubspec.lock
+++ b/packages/faro/example/pubspec.lock
@@ -113,6 +113,13 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.2"
+ faro:
+ dependency: "direct main"
+ description:
+ path: ".."
+ relative: true
+ source: path
+ version: "0.2.0"
ffi:
dependency: transitive
description:
@@ -376,13 +383,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.2.2"
- rum_sdk:
- dependency: "direct main"
- description:
- path: ".."
- relative: true
- source: path
- version: "0.1.2"
shared_preferences:
dependency: transitive
description:
diff --git a/packages/rum_sdk/example/pubspec.yaml b/packages/faro/example/pubspec.yaml
similarity index 96%
rename from packages/rum_sdk/example/pubspec.yaml
rename to packages/faro/example/pubspec.yaml
index cbcf446..1e5fbb7 100644
--- a/packages/rum_sdk/example/pubspec.yaml
+++ b/packages/faro/example/pubspec.yaml
@@ -1,5 +1,5 @@
-name: rum_sdk_example
-description: Demonstrates how to use the rum_sdk plugin.
+name: faro_example
+description: Demonstrates how to use the faro plugin.
publish_to: "none"
environment:
@@ -14,7 +14,7 @@ environment:
dependencies:
flutter:
sdk: flutter
- rum_sdk:
+ faro:
path: ../
http: ^1.2.2
# path: ../../rum_dart
diff --git a/packages/faro/example/pubspec_overrides.yaml b/packages/faro/example/pubspec_overrides.yaml
new file mode 100644
index 0000000..85e472d
--- /dev/null
+++ b/packages/faro/example/pubspec_overrides.yaml
@@ -0,0 +1,4 @@
+# melos_managed_dependency_overrides: faro
+dependency_overrides:
+ faro:
+ path: ..
diff --git a/packages/rum_sdk/example/test/widget_test.dart b/packages/faro/example/test/widget_test.dart
similarity index 57%
rename from packages/rum_sdk/example/test/widget_test.dart
rename to packages/faro/example/test/widget_test.dart
index f949767..e3eed7b 100644
--- a/packages/rum_sdk/example/test/widget_test.dart
+++ b/packages/faro/example/test/widget_test.dart
@@ -5,23 +5,17 @@
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
-import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
-import 'package:rum_sdk_example/main.dart';
+import 'package:faro_example/main.dart';
void main() {
- testWidgets('Verify Platform version', (WidgetTester tester) async {
+ testWidgets('Verify MyApp can run', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
- // Verify that platform version is retrieved.
- expect(
- find.byWidgetPredicate(
- (Widget widget) =>
- widget is Text && widget.data!.startsWith('Running on:'),
- ),
- findsOneWidget,
- );
+ // Verify that MyApp can be built without errors
+ // This test passes if the widget builds without throwing any exceptions
+ expect(find.byType(MyApp), findsOneWidget);
});
}
diff --git a/packages/rum_sdk/ios/.gitignore b/packages/faro/ios/.gitignore
similarity index 100%
rename from packages/rum_sdk/ios/.gitignore
rename to packages/faro/ios/.gitignore
diff --git a/packages/rum_sdk/ios/Assets/.gitkeep b/packages/faro/ios/Assets/.gitkeep
similarity index 100%
rename from packages/rum_sdk/ios/Assets/.gitkeep
rename to packages/faro/ios/Assets/.gitkeep
diff --git a/packages/rum_sdk/ios/Classes/AppStart.swift b/packages/faro/ios/Classes/AppStart.swift
similarity index 100%
rename from packages/rum_sdk/ios/Classes/AppStart.swift
rename to packages/faro/ios/Classes/AppStart.swift
diff --git a/packages/rum_sdk/ios/Classes/CPUInfo.swift b/packages/faro/ios/Classes/CPUInfo.swift
similarity index 100%
rename from packages/rum_sdk/ios/Classes/CPUInfo.swift
rename to packages/faro/ios/Classes/CPUInfo.swift
diff --git a/packages/rum_sdk/ios/Classes/CrashReportingIntegration.swift b/packages/faro/ios/Classes/CrashReportingIntegration.swift
similarity index 100%
rename from packages/rum_sdk/ios/Classes/CrashReportingIntegration.swift
rename to packages/faro/ios/Classes/CrashReportingIntegration.swift
diff --git a/packages/rum_sdk/ios/Classes/RumSdkPlugin.swift b/packages/faro/ios/Classes/FaroPlugin.swift
similarity index 95%
rename from packages/rum_sdk/ios/Classes/RumSdkPlugin.swift
rename to packages/faro/ios/Classes/FaroPlugin.swift
index 94f3a60..4bc0207 100644
--- a/packages/rum_sdk/ios/Classes/RumSdkPlugin.swift
+++ b/packages/faro/ios/Classes/FaroPlugin.swift
@@ -4,10 +4,10 @@ import Foundation
import CrashReporter
-public class RumSdkPlugin: NSObject, FlutterPlugin {
+public class FaroPlugin: NSObject, FlutterPlugin {
public static func register(with registrar: FlutterPluginRegistrar) {
- let channel = FlutterMethodChannel(name: "rum_sdk", binaryMessenger: registrar.messenger())
- let instance = RumSdkPlugin()
+ let channel = FlutterMethodChannel(name: "faro", binaryMessenger: registrar.messenger())
+ let instance = FaroPlugin()
// if(isCrashReportAutoEnabled() == true){
// let crashreporter = CrashReportingIntegration()
diff --git a/packages/rum_sdk/ios/Classes/RefreshRateVitals.swift b/packages/faro/ios/Classes/RefreshRateVitals.swift
similarity index 100%
rename from packages/rum_sdk/ios/Classes/RefreshRateVitals.swift
rename to packages/faro/ios/Classes/RefreshRateVitals.swift
diff --git a/packages/rum_sdk/ios/Classes/RumCrashReport.swift b/packages/faro/ios/Classes/RumCrashReport.swift
similarity index 100%
rename from packages/rum_sdk/ios/Classes/RumCrashReport.swift
rename to packages/faro/ios/Classes/RumCrashReport.swift
diff --git a/packages/rum_sdk/ios/rum_sdk.podspec b/packages/faro/ios/faro.podspec
similarity index 87%
rename from packages/rum_sdk/ios/rum_sdk.podspec
rename to packages/faro/ios/faro.podspec
index 9fd0274..6929544 100644
--- a/packages/rum_sdk/ios/rum_sdk.podspec
+++ b/packages/faro/ios/faro.podspec
@@ -1,10 +1,10 @@
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
-# Run `pod lib lint rum_sdk.podspec` to validate before publishing.
+# Run `pod lib lint faro.podspec` to validate before publishing.
#
Pod::Spec.new do |s|
- s.name = 'rum_sdk'
- s.version = '0.1.2'
+ s.name = 'faro'
+ s.version = '0.2.0'
s.summary = 'A new Flutter plugin project.'
s.description = <<-DESC
A new Flutter plugin project.
diff --git a/packages/rum_sdk/lib/rum_flutter.dart b/packages/faro/lib/faro.dart
similarity index 85%
rename from packages/rum_sdk/lib/rum_flutter.dart
rename to packages/faro/lib/faro.dart
index 1aff9d3..8e231e3 100644
--- a/packages/rum_sdk/lib/rum_flutter.dart
+++ b/packages/faro/lib/faro.dart
@@ -4,34 +4,34 @@ import 'dart:async';
import 'dart:convert';
import 'dart:developer';
import 'dart:io';
+
+import 'package:faro/faro_native_methods.dart';
+import 'package:faro/faro_sdk.dart';
+import 'package:faro/src/data_collection_policy.dart';
+import 'package:faro/src/device_info/session_attributes_provider.dart';
+import 'package:faro/src/models/span_record.dart';
+import 'package:faro/src/tracing/tracer_provider.dart';
+import 'package:faro/src/transport/batch_transport.dart';
+import 'package:faro/src/util/generate_session.dart';
import 'package:flutter/cupertino.dart';
import 'package:package_info_plus/package_info_plus.dart';
-import 'package:rum_sdk/rum_native_methods.dart';
-import 'package:rum_sdk/rum_sdk.dart';
-import 'package:rum_sdk/src/data_collection_policy.dart';
-import 'package:rum_sdk/src/device_info/session_attributes_provider.dart';
-import 'package:rum_sdk/src/models/span_record.dart';
-import 'package:rum_sdk/src/tracing/tracer_provider.dart';
-import 'package:rum_sdk/src/transport/batch_transport.dart';
-import 'package:rum_sdk/src/util/generate_session.dart';
-
Timer? timer;
typedef AppRunner = FutureOr Function();
-class RumFlutter {
- factory RumFlutter() {
+class Faro {
+ factory Faro() {
return _instance;
}
// Private constructor
- RumFlutter._();
+ Faro._();
// Singleton instance
- static RumFlutter _instance = RumFlutter._();
+ static Faro _instance = Faro._();
@visibleForTesting
- static set instance(RumFlutter instance) => _instance = instance;
+ static set instance(Faro instance) => _instance = instance;
bool get enableDataCollection => DataCollectionPolicy().isEnabled;
set enableDataCollection(bool enable) {
@@ -42,7 +42,7 @@ class RumFlutter {
}
}
- RumConfig? config;
+ FaroConfig? config;
List _transports = [];
BatchTransport? _batchTransport;
List get transports => _transports;
@@ -55,12 +55,12 @@ class RumFlutter {
List? ignoreUrls = [];
Map eventMark = {};
- RumNativeMethods? _nativeChannel;
+ FaroNativeMethods? _nativeChannel;
- RumNativeMethods? get nativeChannel => _nativeChannel;
+ FaroNativeMethods? get nativeChannel => _nativeChannel;
@visibleForTesting
- set nativeChannel(RumNativeMethods? nativeChannel) {
+ set nativeChannel(FaroNativeMethods? nativeChannel) {
_nativeChannel = nativeChannel;
}
@@ -74,12 +74,12 @@ class RumFlutter {
_batchTransport = batchTransport;
}
- Future init({required RumConfig optionsConfiguration}) async {
+ Future init({required FaroConfig optionsConfiguration}) async {
final attributesProvider =
await SessionAttributesProviderFactory().create();
meta.session?.attributes = await attributesProvider.getAttributes();
- _nativeChannel ??= RumNativeMethods();
+ _nativeChannel ??= FaroNativeMethods();
config = optionsConfiguration;
_batchTransport = _batchTransport ??
BatchTransport(
@@ -88,8 +88,8 @@ class RumFlutter {
transports: _transports);
if (config?.transports == null) {
- RumFlutter()._transports.add(
- RUMTransport(
+ Faro()._transports.add(
+ FaroTransport(
collectorUrl: optionsConfiguration.collectorUrl ?? '',
apiKey: optionsConfiguration.apiKey,
maxBufferLimit: config?.maxBufferLimit,
@@ -97,7 +97,7 @@ class RumFlutter {
),
);
} else {
- RumFlutter()._transports.addAll(config?.transports ?? []);
+ Faro()._transports.addAll(config?.transports ?? []);
}
_instance.ignoreUrls = optionsConfiguration.ignoreUrls ?? [];
final packageInfo = await PackageInfo.fromPlatform();
@@ -128,11 +128,11 @@ class RumFlutter {
WidgetsBinding.instance.addPostFrameCallback((_) {
NativeIntegration.instance.getAppStart();
});
- WidgetsBinding.instance.addObserver(RumWidgetsBindingObserver());
+ WidgetsBinding.instance.addObserver(FaroWidgetsBindingObserver());
}
Future runApp(
- {required RumConfig optionsConfiguration,
+ {required FaroConfig optionsConfiguration,
required AppRunner? appRunner}) async {
OnErrorIntegration().call();
FlutterErrorIntegration().call();
@@ -193,7 +193,7 @@ class RumFlutter {
Map? trace,
}) {
_batchTransport?.addLog(
- RumLog(message, level: level, context: context, trace: trace),
+ FaroLog(message, level: level, context: context, trace: trace),
);
return null;
}
@@ -210,10 +210,10 @@ class RumFlutter {
}) {
var parsedStackTrace = {};
if (stacktrace != null) {
- parsedStackTrace = {'frames': RumException.stackTraceParse(stacktrace)};
+ parsedStackTrace = {'frames': FaroException.stackTraceParse(stacktrace)};
}
_batchTransport?.addExceptions(
- RumException(type, value, parsedStackTrace, context: context),
+ FaroException(type, value, parsedStackTrace, context: context),
);
return null;
}
@@ -313,7 +313,7 @@ class RumFlutter {
}
} catch (error, stacktrace) {
log(
- 'RumFlutter: enableCrashReporter failed with error: $error',
+ 'Faro: enableCrashReporter failed with error: $error',
stackTrace: stacktrace,
);
}
diff --git a/packages/faro/lib/faro_native_methods.dart b/packages/faro/lib/faro_native_methods.dart
new file mode 100644
index 0000000..2c3d395
--- /dev/null
+++ b/packages/faro/lib/faro_native_methods.dart
@@ -0,0 +1,47 @@
+import 'package:faro/faro_sdk_platform_interface.dart';
+
+class FaroNativeMethods {
+ Future getMemoryUsage() {
+ return FaroSdkPlatform.instance.getMemoryUsage();
+ }
+
+ Future getRefreshRate() {
+ return FaroSdkPlatform.instance.getRefreshRate();
+ }
+
+ Future initRefreshRate() {
+ return FaroSdkPlatform.instance.initRefreshRate();
+ }
+
+ Future getCpuUsage() {
+ return FaroSdkPlatform.instance.getCpuUsage();
+ }
+
+ Future