vunet_flutter_plugin 0.0.1
vunet_flutter_plugin: ^0.0.1 copied to clipboard
A Flutter plugin from VunetSystems for Mobile Real User Monitoring.
vunet_flutter_plugin #
Real User Monitoring (RUM) for Flutter apps, from VuNet Systems.
The Flutter layer collects spans — navigation, HTTP, image loads, user interactions, custom actions, errors and jank — and bridges them to the native VuNet Android/iOS agent, which owns the resource, the session and the OTLP export.
Install #
dependencies:
vunet_flutter_plugin: ^0.0.1
vunet_flutter_plugin_dio: ^0.0.1 # optional — Dio spans
vunet_flutter_plugin_go_router: ^0.0.1 # optional — go_router navigation
vunet_flutter_plugin_cached_network_image: ^0.0.1 # optional — cached_network_image loads
Requires Flutter ≥ 3.29.2 / Dart ≥ 3.7.2. Android and iOS only.
Platform setup #
Android #
Minimum API 24. The native agent needs core library desugaring, in
android/app/build.gradle.kts:
android {
compileOptions {
isCoreLibraryDesugaringEnabled = true
}
defaultConfig {
minSdk = 24
}
}
dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
}
The VuNet Android agent is currently published as a snapshot, so the snapshots
repository has to be resolvable from your build. Add it in
android/settings.gradle.kts:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url = uri("https://central.sonatype.com/repository/maven-snapshots/") }
}
}
iOS #
Minimum iOS 13. The plugin vendors the vuTelemetry.xcframework and pulls it in
through its podspec — pod install is all that is needed.
Initialise #
import 'package:flutter/material.dart';
import 'package:vunet_flutter_plugin/flutter_sdk.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await VuTelemetry.initialize(
params: InitializationParams(
baseUri: 'https://collector.example.com', // no /v1/... suffix
appName: '<your-app-name>',
apiKey: '<your-api-key>',
buildType: 'release',
logLevel: SdkLogLevel.info,
instrumentations: InstrumentationsConfig(
http: true,
jankDetection: true,
),
),
);
runApp(const MainApp());
}
| Parameter | Notes |
|---|---|
baseUri |
OTLP collector base URI from your MRUM o11ySource. |
appName / apiKey |
Provided by the MRUM o11ySource. |
buildType |
Build flavour, e.g. debug, release, uat. |
logLevel |
SDK diagnostics: off, info (default), debug. |
instrumentations.errors |
Default true — UI and platform error handlers. |
instrumentations.http |
Default false — dart:io HTTP. Does not cover Dio. |
instrumentations.jankDetection |
Default false — app.jank spans. |
To capture cold start and startup crashes the native SDK can boot before
Application.onCreate via a build-time vunet.config.yaml; ask VuNet support
for the early-init setup.
What you get #
- Navigation — add
RouteObserverService()tonavigatorObservers(RouteObserverService.nested()per embeddedNavigator). Every span then carriesscreen.name. Tab and bottom-nav switches are reported throughVuTabScope/VuIndexScope/VuTelemetry.logTabChange. - HTTP —
instrumentations.http: trueinstrumentsdart:ioandpackage:http. Dio needsvunet_flutter_plugin_dio. - Image loads —
VuNetworkImageand the image provider adapters emitimage.loadspans;cached_network_imageneedsvunet_flutter_plugin_cached_network_image. - User interactions —
VuTelemetry.logInteraction(...)withInteractionTypesrecords taps and gestures as action spans that adopt the work they trigger. - Custom actions and errors —
VuTelemetry.action.startAction/VuTelemetry.action.withActionfor scopedvunet.custom.actionspans, andVuTelemetry.error.record(...)for handled errors. - Custom attributes —
VuTelemetry.setCustomAttribute(...), applied natively to every span.
Import package:vunet_flutter_plugin/flutter_sdk.dart for all of the above; it
is the only consumer-facing entry point.
License #
VuNet Systems Ltd. proprietary and confidential
(LicenseRef-VuNet-Proprietary) for VuNet-authored code; Apache-2.0 for the
bundled OpenTelemetry Dart fork and the generated OpenTelemetry proto bindings.
See LICENSE and NOTICE.