- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
Enable React Native Crash Reporting and Error Tracking to get comprehensive crash reports and error trends with Real User Monitoring.
Each time you release a new CodePush version for your React Native application, you need to upload the source maps to Datadog to unminify errors.
Datadog recommends using @datadog/mobile-react-native-code-push
in your app and the datadog-ci react-native codepush
command to upload your source maps. This ensures that the version
is consistent in both reported crashes and uploaded source maps.
If you experience any issues setting up the Datadog SDK with codepush, you can see our example application as a reference.
See the React Native Monitoring installation steps to install @datadog/mobile-react-native
.
Then, install @datadog/mobile-react-native-code-push
.
To install with NPM, run:
npm install @datadog/mobile-react-native-code-push
To install with Yarn, run:
yarn add @datadog/mobile-react-native-code-push
Replace DdSdkReactNative.initialize
by DatadogCodepush.initialize
in your code:
import { DdSdkReactNativeConfiguration } from '@datadog/mobile-react-native';
import { DatadogCodepush } from '@datadog/mobile-react-native-code-push';
const config = new DdSdkReactNativeConfiguration(
'<CLIENT_TOKEN>',
'<ENVIRONMENT_NAME>',
'<RUM_APPLICATION_ID>',
true, // track user interactions (such as a tap on buttons). You can use the 'accessibilityLabel' element property to give the tap action a name, otherwise the element type is reported
true, // track XHR resources
true // track errors
);
await DatadogCodepush.initialize(config);
Replace DatadogProvider
by DatadogCodepushProvider
in your App component:
import { DatadogCodepushProvider } from '@datadog/mobile-react-native-code-push';
export default function App() {
return (
<DatadogCodepushProvider configuration={datadogConfiguration}>
<Navigation />
</DatadogCodepushProvider>
);
}
As getting the CodePush version is an asynchronous step that needs to be performed before initializing the Datadog React Native SDK for RUM, there is no difference between InitializationMode.SYNC
and InitializationMode.ASYNC
when using DatadogCodepushProvider
.
Install @datadog/datadog-ci
as a development dependency to your project.
To install it with NPM:
npm install @datadog/datadog-ci --save-dev
To install it with Yarn:
yarn add -D @datadog/datadog-ci
Create a gitignored datadog-ci.json
file at the root of your project containing your API key and the Datadog site (if not datadoghq.com
):
{
"apiKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"site": "datadoghq.eu"
}
You can also export them as DATADOG_API_KEY
and DATADOG_SITE
environment variables.
When releasing a new CodePush bundle, specify a directory to output the source maps and bundle:
appcenter codepush release-react -a MyOrganization/MyApplication -d MyDeployment --sourcemap-output --output-dir ./build
Run the datadog-ci react-native codepush
command by passing the adequate CodePush app
and deployment
arguments.
To run it with NPM:
npm run datadog-ci react-native codepush --platform ios --service com.company.app --bundle ./build/CodePush/main.jsbundle --sourcemap ./build/CodePush/main.jsbundle.map --app MyOrganization/MyApplication --deployment MyDeployment
To run it with Yarn:
yarn datadog-ci react-native codepush --platform ios --service com.company.app --bundle ./build/CodePush/main.jsbundle --sourcemap ./build/CodePush/main.jsbundle.map --app MyOrganization/MyApplication --deployment MyDeployment
These steps ensure that the version
matches the format {commercialVersion}-codepush.{codePushLabel}
, such as 1.2.4-codepush.v3
.
You can also do that by specifying a versionSuffix
in the SDK configuration:
const config = new DdSdkReactNativeConfiguration(
'<CLIENT_TOKEN>',
'<ENVIRONMENT_NAME>',
'<RUM_APPLICATION_ID>',
true, // track User interactions (e.g.: Tap on buttons. You can use 'accessibilityLabel' element property to give tap action the name, otherwise element type will be reported)
true, // track XHR Resources
true // track Errors
);
config.versionSuffix = `codepush.${codepushVersion}`; // will result in "1.0.0-codepush.v2"
In order to avoid potential version clashes, the versionSuffix
adds a dash (-
) before the suffix.
To obtain the codepushVersion
, you can hardcode it or use CodePush.getUpdateMetadata
.
Then, upload your source maps using the datadog-ci react-native upload
command, and ensure the --release-version
argument matches the one set in the SDK configuration.
RUM ensures availability of data when your user device is offline. In case of low-network areas, or when the device battery is too low, all the RUM events are first stored on the local device in batches.
Each batch follows the intake specification. They are sent as soon as the network is available, and the battery is high enough to ensure the Datadog SDK does not impact the end user’s experience. If the network is not available while your application is in the foreground, or if an upload of data fails, the batch is kept until it can be sent successfully.
This means that even if users open your application while offline, no data is lost. To ensure the SDK does not use too much disk space, the data on the disk is automatically discarded if it gets too old.