Skip to main content

kubesense_dio 1.0.0 copy "kubesense_dio: ^1.0.0" to clipboard
kubesense_dio: ^1.0.0 copied to clipboard

Support tracking and distributed tracing of Dio network requests in Kubesense.

Kubesense Dio integration #

A package for use with Dio and the Kubesense SDK, used to track performance of HTTP calls and enable Kubesense Distributed Tracing.

Getting started #

To use the Kubesense Dio Interceptor, call addKubesenseInterceptor on your Dio object:

import 'package:kubesense_dio/kubesense_dio.dart'

Dio dio = Dio()
  // Other Dio configuration...
  ..addKubesenseInterceptor(KubesenseSdk.instance);

In order to enable Kubesense Distributed Tracing, you also need to set the firstPartyHosts property when configuring Kubesense.

import 'package:kubesense_tracking_http_client/kubesense_tracking_http_client.dart';

final configuration = KubesenseConfiguration(
  // configuration
  firstPartyHosts: ['example.com'],
)

Use with other Dio interceptors #

addKubesenseInterceptor adds the Kubesense interceptor as the first interceptor in your list of interceptors, which is important to ensure that all network requests from Dio are sent to Kubesense, as other interceptors may decide not to forward information down the interceptor chain. For this reason, it is important to make sure you call addKubesenseInterceptor after any other configuration of Dio is complete.

Use with other Kubesense Network Tracking #

Clients that want to track all network requests, including those made by dart:io and widgets like NetworkImage can continue to use kubesense_tracking_http_client to capture these requests. However, depending on your setup, the global overide method used in enableHttpTracking may cause resources to be double reported (once by the global override and once by the Dio interceptor).

To avoid this, we recommend using ignoreUrlPatterns parameter when calling enableHttpTracking to ignore requests made by your Dio client.

License #

Apache License, v2.0

0
likes
140
points
40
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Support tracking and distributed tracing of Dio network requests in Kubesense.

Homepage

License

Apache-2.0 (license)

Dependencies

dio, flutter, kubesense_flutter_plugin, uuid

More

Packages that depend on kubesense_dio