Flutter Libraries for RUM
This page lists integrated libraries you can use for Flutter applications.
GraphQL (gql_link)
Datadog provides datadog_gql_link
for use with most GraphQL Flutter libraries, including graphql_flutter
and ferry
.
Setup
Add datadog_gql_link
to your pubspec.yaml
or by running flutter pub add datadog_gql_link
from your terminal:
dependencies:
# Other dependencies
datadog_gql_link: ^1.0.0
When creating your GraphQL link, add the DatadogGqlLink
above your terminating link. For example:
final graphQlUrl = "https://example.com/graphql";
final link = Link.from([
DatadogGqlLink(DatadogSdk.instance, Uri.parse(graphQlUrl)),
HttpLink(graphQlUrl),
]);
If you are tracking non-GraphQL network calls with datadog_tracking_http_client
, you need to configure the tracking plugin to ignore requests to your GraphQL endpoint. Otherwise, GraphQL resources will be reported twice, and APM traces may be broken. Ignore your GraphQL endpoint by using the ignoreUrlPatterns
parameter added to datadog_tracking_http_client
version 2.1.0.
final datadogConfig = DatadogConfiguration(
// Your configuration
)..enableHttpTracking(
ignoreUrlPatterns: [
RegExp('example.com/graphql'),
],
);
Further Reading
Additional helpful documentation, links, and articles: