- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
",t};e.buildCustomizationMenuUi=t;function n(e){let t='
",t}function s(e){let n=e.filter.currentValue||e.filter.defaultValue,t='${e.filter.label}
`,e.filter.options.forEach(s=>{let o=s.id===n;t+=``}),t+="${e.filter.label}
`,t+=`Error Tracking processes errors collected from the browser by the Browser SDK. Whenever a source, custom, report, or console error containing a stack trace is collected, Error Tracking processes and groups it under an issue, or group of similar errors to be found in the Error Tracking Explorer.
Download the latest version of the Browser SDK.
To start sending Error Tracking data from your browser application to Datadog, follow the in-app setup instructions or follow the steps below.
clientToken
and an applicationId
for your application.Choose the installation type for the Browser SDK.
Installing through npm (Node Package Manager) is recommended for modern web applications. The Browser SDK is packaged with the rest of your frontend JavaScript code. It has no impact on page load performance. However, the SDK may miss errors, resources, and user actions triggered before the SDK is initialized. Datadog recommends using a matching version with the Browser Logs SDK.
Add @datadog/browser-rum
to your package.json
file, then initialize it with:
import { datadogRum } from '@datadog/browser-rum';
datadogRum.init({
applicationId: '<APP_ID>',
clientToken: '<CLIENT_TOKEN>',
service: '<SERVICE>',
env: '<ENV_NAME>',
// site: '<SITE>',
// version: '1.0.0',
trackUserInteractions: true,
trackResources: true
});
The trackUserInteractions
parameter enables the automatic collection of user clicks in your application. Sensitive and private data contained in your pages may be included to identify the elements interacted with.
Installing through CDN async is recommended for web applications with performance targets. The Browser SDK loads from Datadog’s CDN asynchronously, ensuring the SDK download does not impact page load performance. However, the SDK may miss errors, resources, and user actions triggered before the SDK is initialized.
Add the generated code snippet to the head tag of every HTML page you want to monitor in your application. For the site:
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/us1/v6/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APP_ID>',
// site: '<SITE>',
service: '<APP_ID>',
env: '<ENV_NAME>',
// version: '1.0.0'
});
})
</script>
The trackUserInteractions
parameter enables the automatic collection of user clicks in your application. Sensitive and private data contained in your pages may be included to identify the elements interacted with.
Installing through CDN sync is recommended for collecting all events. The Browser SDK loads from Datadog’s CDN synchronously, ensuring the SDK loads first and collects all errors, resources, and user actions. This method may impact page load performance.
Add the generated code snippet to the head tag (in front of any other script tags) of every HTML page you want to monitor in your application. Placing the script tag higher and loading it synchronously ensures Datadog RUM can collect all performance data and errors. For the site:
<script
src="https://www.datadoghq-browser-agent.com/us1/v6/datadog-rum.js"
type="text/javascript">
</script>
<script>
window.DD_RUM && window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APP_ID>',
// site: '<SITE>',
service: '<APP_ID>',
env: '<ENV_NAME>',
// version: '1.0.0'
});
</script>
The trackUserInteractions
parameter enables the automatic collection of user clicks in your application. Sensitive and private data contained in your pages may be included to identify the elements interacted with.
If you are initializing the SDK in a TypeScript project, use the code snippet below. Types are compatible with TypeScript >= 3.8.2.
import '@datadog/browser-rum/bundle/datadog-rum'
window.DD_RUM.init({
applicationId: 'XXX',
clientToken: 'XXX',
site: 'datadoghq.com',
trackUserInteractions: true,
trackResources: true,
...
})
env
) for your application to use unified service tagging.service
) for your application to use unified service tagging.version
) for your deployed application in the initialization snippet. For more information, see Tagging.Deploy the changes to your application. After your deployment is live, Datadog collects events from your users’ browsers.
Upload your JavaScript source maps to access unminified stack traces. See the source map upload guide.
Now that you’ve completed the basic setup for Browser Error Tracking, your application is collecting browser errors and you can start monitoring and debugging issues in real-time.
Visualize the data collected in dashboards or create a search query in Error Tracking.
Until Datadog starts receiving data, your application appears as pending
on the Applications page.
In addition to sending source maps, the Datadog CLI reports Git information such as the commit hash, repository URL, and a list of tracked file paths in the code repository.
Error Tracking can use this information to correlate errors with your source code, allowing you to pivot from any stack trace frame to the related line of code in GitHub, GitLab and Bitbucket.
0.12.0
and later.For more information, see the Datadog Source Code Integration.
These tags (configured in step 3 above) power Error Tracking functionality:
service
and env
service
/env
service
and version
you configure during uploadA service is an independent, deployable code repository that maps to a set of pages:
Learn more about tagging in Datadog.
Call the initialization command to start tracking. The below parameters are available.
These parameters are essential for the Browser SDK to function. You must provide both values to initialize Error Tracking.
Parameter | Type | Default | Description |
---|---|---|---|
applicationId | String | - | The application ID. |
clientToken | String | - | A Datadog client token. |
These parameters define your application’s identity and environment. They’re used for unified service tagging and help organize your data across Datadog products.
Parameter | Type | Default | Description |
---|---|---|---|
env | String | - | The application’s environment (for example: prod, pre-prod, staging). Follows the tag syntax requirements. |
service | String | - | The service name for your application. Follows the tag syntax requirements. |
site | String | datadoghq.com | The Datadog site parameter of your organization. |
version | String | - | The application’s version (for example: 1.2.3, 6c44da20). Follows the tag syntax requirements. |
These parameters control how user data is collected and protected. Configure them based on your privacy requirements and compliance needs.
Parameter | Type | Default | Description |
---|---|---|---|
defaultPrivacyLevel | String | mask | See Session Replay Privacy Options. |
enablePrivacyForActionName | Boolean | false | See Mask Action Names. |
trackingConsent | "granted" or "not-granted" | "granted" | Set the initial user tracking consent state. See User Tracking Consent. |
These parameters control what data is automatically collected from user interactions and pageviews. Enable them based on your monitoring needs.
Parameter | Type | Default | Description |
---|---|---|---|
actionNameAttribute | String | - | Specify your own attribute to be used to name actions. |
sessionSampleRate | Number | 100 | The percentage of sessions to track: 100 for all, 0 for none. See sampling configuration. |
trackResources | Boolean | false | Enables collection of resource events. |
trackUserInteractions | Boolean | false | Enables automatic collection of user actions. |
trackViewsManually | Boolean | false | Allows you to control views creation. See override default view names. |
These parameters provide fine-grained control over SDK behavior, networking, and performance. Use them for advanced use cases and custom configurations.
Parameter | Type | Default | Description |
---|---|---|---|
compressIntakeRequests | Boolean | false | Compresses intake requests to reduce bandwidth usage. |
excludedActivityUrls | List | - | A list of request origins ignored when computing page activity. See How page activity is calculated. |
proxy | String | - | Optional proxy URL. See the full proxy setup guide. |
silentMultipleInit | Boolean | false | Initialization fails silently if the RUM Browser SDK is already initialized. |
workerUrl | String | - | URL pointing to the Datadog Browser SDK Worker JavaScript file. See Content Security Policy guidelines. |
These parameters control how user context and application state are preserved across page navigation and browser sessions.
Parameter | Type | Default | Description |
---|---|---|---|
allowUntrustedEvents | Boolean | false | Allow capture of untrusted events, for example in automated UI tests. |
storeContextsAcrossPages | Boolean | false | Store global context and user context in localStorage to preserve them along user navigation. See Contexts life cycle. |
These parameters ensure compatibility when using both the RUM Browser SDK and Logs Browser SDK together. They must have matching configuration values across both SDKs to maintain consistent session tracking and data correlation.
Parameter | Type | Default | Description |
---|---|---|---|
allowFallbackToLocalStorage | Boolean | false | Deprecated - Use sessionPersistence instead. |
sessionPersistence | "cookie" | "local-storage" | "cookie" | Which storage strategy to use for persisting sessions. Can be either cookie or local-storage . |
trackSessionAcrossSubdomains | Boolean | false | Preserve the session across subdomains for the same site. |
usePartitionedCrossSiteSessionCookie | Boolean | false | Use a partitioned secure cross-site session cookie. This allows the Browser SDK to run when the site is loaded from another one (iframe). Implies useSecureSessionCookie . |
useSecureSessionCookie | Boolean | false | Use a secure session cookie. This disables events sent on insecure (non-HTTPS) connections. |
See all uploaded symbols and manage your source maps on the Debug Symbols page.
Note: Source maps are limited in size to 500 MB each.
You can monitor unhandled exceptions, unhandled promise rejections, handled exceptions, handled promise rejections, and other errors that the Browser SDK does not automatically track. Learn more about Collecting Browser Errors.