Choose an integration
Pick the package that matches the client your application uses:
All of them report resources on their own. To also connect those resources to your backend traces, list your API domains in
firstPartyHosts. See Flutter Distributed Tracing.
Track HTTP requests
atatus_tracking_http_client tracks requests made with dart:io HttpClient. The http package uses HttpClient underneath on Android, so this one integration covers both.
Add the package to your pubspec.yaml:
enableHttpTracking() on your configuration before you initialize the SDK:
HttpClient created after initialization is then tracked, with no change to your request code.
Ignore specific URLs
PassignoreUrlPatterns to skip requests you do not want reported, such as health checks or an endpoint already tracked by another integration:
Wrap a single http client
AtatusClient is a composable http.Client you create yourself. Use it instead of enableHttpTracking() when either of these is true:
- You use a native HTTP library such as
cronet_httporcupertino_http. Those do not go throughdart:ioHttpClient, so global tracking cannot see them. - You want to track only some requests rather than all of them.
innerClient is optional. Leave it out and AtatusClient creates a default http.Client for you. Because it wraps any http.BaseClient, you can compose it with other clients such as a retry client.
AtatusClient also accepts ignoreUrlPatterns, and an attributesProvider that lets you attach your own attributes to each resource:
Use one approach or the other.
AtatusClient and enableHttpTracking() both track the same http package traffic, so using both reports each request twice. The exception is cronet_http and cupertino_http, which global tracking cannot see at all, so the two can safely run together in that case.Track Dio requests
atatus_dio reports Dio requests as RUM resources. Add the package:
addAtatusInterceptor inserts the Atatus interceptor at the front of the list, so it sees every request even if a later interceptor stops the chain. Call it after the rest of your Dio setup so nothing displaces it.Dio options
addAtatusInterceptor accepts four optional parameters:
To add your own attributes, implement
AtatusDioAttributeProvider:
onRequest land on the resource when it starts. Attributes from onResponse and onError land on it when it finishes.
Track gRPC requests
atatus_grpc_interceptor reports gRPC calls as RUM resources. Add the package:
grpc.method attribute.
The gRPC interceptor tracks unary calls only. Streaming calls are not intercepted and do not appear as resources.
Track GraphQL requests
atatus_gql_link reports GraphQL operations as RUM resources and records the operation name, the operation type, and the variables. Add the package:
AtatusGqlLink above your terminating link:
AtatusGqlLink is not a terminating link, so it always needs a link such as HttpLink after it.
What is collected from a GraphQL operation
Each operation carries these attributes in addition to the usual resource fields:Track a custom resource
If none of the integrations covers a request, report it yourself withstartResource and stopResource. See Manually track custom resources.
Next steps
- Connect resources to your backend with Flutter Distributed Tracing.
- Configure the rest of the agent in Flutter Agent Configuration Options.
- Record what your users saw with Flutter Session Replay.