vunet_flutter_plugin 0.0.1 copy "vunet_flutter_plugin: ^0.0.1" to clipboard
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 falsedart:io HTTP. Does not cover Dio.
instrumentations.jankDetection Default falseapp.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() to navigatorObservers (RouteObserverService.nested() per embedded Navigator). Every span then carries screen.name. Tab and bottom-nav switches are reported through VuTabScope / VuIndexScope / VuTelemetry.logTabChange.
  • HTTPinstrumentations.http: true instruments dart:io and package:http. Dio needs vunet_flutter_plugin_dio.
  • Image loadsVuNetworkImage and the image provider adapters emit image.load spans; cached_network_image needs vunet_flutter_plugin_cached_network_image.
  • User interactionsVuTelemetry.logInteraction(...) with InteractionTypes records taps and gestures as action spans that adopt the work they trigger.
  • Custom actions and errorsVuTelemetry.action.startAction / VuTelemetry.action.withAction for scoped vunet.custom.action spans, and VuTelemetry.error.record(...) for handled errors.
  • Custom attributesVuTelemetry.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.