- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
This page lists integrated libraries you can use for Flutter applications.
Datadog provides datadog_gql_link
for use with most GraphQL Flutter libraries, including graphql_flutter
and ferry
.
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'),
],
);
If you are using Flutter Navigator v2.0, your setup for automatic view tracking differs depending on your routing middleware. This section explains how to integrate with the most popular routing packages.
Because go_router uses the same observer interface as Flutter Navigator v1, you can add DatadogNavigationObserver
to other observers as a parameter to GoRouter
.
final _router = GoRouter(
routes: [
// Your route information here
],
observers: [
DatadogNavigationObserver(datadogSdk: DatadogSdk.instance),
],
);
MaterialApp.router(
routerConfig: _router,
// Your remaining setup
);
If you are using ShellRoutes, you need to supply a separate observer to each ShellRoute
, as shown below. See this bug for more information.
final _router = GoRouter(
routes: [
ShellRoute(build: shellBuilder),
routes: [
// Additional routes
],
observers: [
DatadogNavigationObserver(datadogSdk: DatadogSdk.instance),
],
],
observers: [
DatadogNavigationObserver(datadogSdk: DatadogSdk.instance),
],
);
MaterialApp.router(
routerConfig: _router,
// Your remaining setup
);
Additionally, if you are using GoRoute
’s pageBuilder
parameter over its builder
parameter, ensure that you are passing on the state.pageKey
value and the name
value to your MaterialPage
.
GoRoute(
name: 'My Home',
path: '/path',
pageBuilder: (context, state) {
return MaterialPage(
key: state.pageKey, // Necessary for GoRouter to call Observers
name: name, // Needed for Datadog to get the right route name
child: _buildContent(),
);
},
),
AutoRoute can use a DatadogNavigationObserver
provided as one of the navigatorObservers
as part of its config
method.
return MaterialApp.router(
routerConfig: _router.config(
navigatorObservers: () => [
DatadogNavigationObserver(
datadogSdk: DatadogSdk.instance,
),
],
),
// Your remaining setup
);
However, if you are using AutoRoute’s tab routing, you need to extend Datadog’s default observer with AutoRoute’s AutoRouteObserver
interface.
class DatadogAutoRouteObserver extends DatadogNavigationObserver
implements AutoRouterObserver {
DatadogAutoRouteObserver({required super.datadogSdk});
// only override to observer tab routes
@override
void didInitTabRoute(TabPageRoute route, TabPageRoute? previousRoute) {
datadogSdk.rum?.startView(route.path, route.name);
}
@override
void didChangeTabRoute(TabPageRoute route, TabPageRoute previousRoute) {
datadogSdk.rum?.startView(route.path, route.name);
}
}
This new object replaces the simpler DatadogNavigationObserver
.
Beamer can use the DatadogNavigationObserver
as an argument to BeamerDelegate
:
final routerDelegate = BeamerDelegate(
locationBuilder: RoutesLocationBuilder(
routes: {
// Your route config
},
),
navigatorObservers: [
DatadogNavigationObserver(DatadogSdk.instance),
]
);
추가 유용한 문서, 링크 및 기사: