---
title: Electron Data Collected
description: >-
  Understand the events, attributes, and traces collected by the RUM Electron
  SDK.
breadcrumbs: >-
  Docs > RUM & Session Replay > Application Monitoring > Electron Monitoring >
  Electron Data Collected
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Electron Data Collected

## Overview{% #overview %}

The Electron SDK collects data from two sources:

- **Renderer processes** are monitored by the Browser SDK. Views, actions, resources, errors, and other renderer events follow the [Browser data collected](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/browser/data_collected.md) reference.
- **The main process** is monitored by the Electron SDK, which generates RUM events, and by `dd-trace-js`, which generates traces.

Every event has attributes. See the Shared attributes section. Quantifiable attributes can be used for measurements related to the event, while non-quantifiable attributes can be used to filter and group telemetry in analytics (group by). You can further enrich your data by [adding global context](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/electron/advanced_configuration.md#global-context).

## Main process RUM events{% #main-process-rum-events %}

| Event type | Retention | Description                                                                                                                                                                                                                                                                                                                                                         |
| ---------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Session    | 30 days   | A session represents a continuous usage period in your application. All RUM events generated during the session, from the main process and the renderer processes, share the same `session.id`.                                                                                                                                                                     |
| Error      | 30 days   | An error represents an exception or problem in the main process, such as an uncaught Node.js error or a native crash.                                                                                                                                                                                                                                               |
| Resource   | 15 days   | A resource represents a network request made by the main process.                                                                                                                                                                                                                                                                                                   |
| Vital      | 15 days   | A vital represents a [custom duration vital](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/electron/advanced_configuration.md#custom-duration-vitals) or an [operation](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/electron/advanced_configuration.md#operation-monitoring) step recorded in the main process. |

Main process events are not attached to a view.

## Execution context{% #execution-context %}

An execution context is a unit of code execution, such as an operating system process of your application. Events carry the following attributes to identify the process that generated them:

| Attribute name           | Type   | Description                                                          |
| ------------------------ | ------ | -------------------------------------------------------------------- |
| `execution_context.id`   | string | Unique identifier (UUID) of the execution context.                   |
| `execution_context.type` | string | Type of the execution context: `main-process` or `renderer-process`. |
| `execution_context.name` | string | Name of the execution context. See the following table.              |

The name of the main process is `Main Process`. The name of a renderer process is derived from the URL of its window, after the page is loaded:

| Window URL                                         | Name                                                           |
| -------------------------------------------------- | -------------------------------------------------------------- |
| External host (for example, `https://example.com`) | Origin and path. Query, fragment, and credentials are dropped. |
| `localhost` or a custom protocol such as `app://`  | Path, query, and hash.                                         |
| `file://`                                          | Filename, followed by any query and hash.                      |

Names are truncated to 200 characters. You can modify `execution_context.name` in [`beforeSendRum`](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/electron/advanced_configuration.md#modify-or-drop-rum-events).

To filter events by process in the RUM Explorer, use the `execution_context.type` facet. For example, `@execution_context.type:main-process` shows only events generated by the main process.

## Main process traces{% #main-process-traces %}

The Electron SDK uses and configures `dd-trace-js`, so tracing requires no additional setup. The SDK generates traces for the following main process activity:

- Network requests
- Command execution

To control how many traces are kept, see [Trace sampling rules](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/electron/advanced_configuration.md#trace-sampling-rules).

## Shared attributes{% #shared-attributes %}

The following attributes are attached to events from the main process and the renderer processes.

### Common core attributes{% #common-core-attributes %}

| Attribute name   | Type    | Description                                                                                                                                                                                                                                                                  |
| ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `application.id` | string  | The RUM application ID.                                                                                                                                                                                                                                                      |
| `date`           | integer | Start of the event in milliseconds from epoch.                                                                                                                                                                                                                               |
| `service`        | string  | The [unified service name](https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging.md) for this application. Main process events report the `service` set in the Electron SDK `init`. Renderer events report the `service` set in the Browser SDK `init`. |
| `env`            | string  | The environment tag (for example, `production` or `staging`), set with the `env` initialization parameter.                                                                                                                                                                   |
| `version`        | string  | The application version. Main process events report the `version` set in the Electron SDK `init`. Renderer events report the `version` set in the Browser SDK `init`.                                                                                                        |
| `type`           | string  | The type of the event (for example, `session`, `error`, or `resource`).                                                                                                                                                                                                      |

For the initialization parameters, see [Initialization parameters](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/electron/advanced_configuration.md#initialization-parameters). To choose `service` and `version` values that match your uploaded source maps, see [Prepare your source maps](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/electron/error_tracking.md#prepare-your-source-maps).

### Operating system{% #operating-system %}

Datadog derives the following attributes from the user agent that the SDK sends with its uploads. The SDK builds this user agent from the operating system, its version, and the CPU architecture.

| Attribute name     | Type   | Description                                                                                     |
| ------------------ | ------ | ----------------------------------------------------------------------------------------------- |
| `os.name`          | string | The OS name, as reported in the user agent.                                                     |
| `os.version`       | string | The OS version, as reported in the user agent. Linux user agents do not include the OS version. |
| `os.version_major` | string | The OS major version, as reported in the user agent.                                            |

### Device{% #device %}

Datadog derives the following attribute from the same user agent.

| Attribute name | Type   | Description                                     |
| -------------- | ------ | ----------------------------------------------- |
| `device.type`  | string | The device type, as reported in the user agent. |

### Geolocation{% #geolocation %}

Datadog resolves geolocation attributes (`geo.country`, `geo.city`, and others) from the client IP address. To stop collecting them, change the setting in your [application details](https://docs.datadoghq.com/data_security/real_user_monitoring.md#geolocation).

### User and account attributes{% #user-and-account-attributes %}

Events from the main process and the renderer processes include the user (`usr.id`, `usr.name`, `usr.email`) and account (`acc.id`, `acc.name`) information you set. See [User and account information](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/electron/advanced_configuration.md#user-and-account-information).

### Global context{% #global-context %}

Attributes set with the global context are sent in the `context` field of events. Renderer processes keep their own global context, set with the Browser SDK. Both are merged on renderer events, and the renderer value wins when a key is in both. See [Global context](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/electron/advanced_configuration.md#global-context).

## Data storage{% #data-storage %}

The SDK stores events on disk before uploading them to Datadog. Events are preserved across application restarts, so data collected before an unexpected shutdown is sent on the next launch.

The [tracking consent](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/electron/advanced_configuration.md#tracking-consent) decides what the SDK keeps and sends. While consent is `'pending'`, the SDK keeps data on disk until the end user decides. It deletes data kept while consent is pending if no decision is made before the next launch. When consent is `'not-granted'`, the SDK does not store new data.

## Further reading{% #further-reading %}

Additional helpful documentation, links, and articles:

- [Electron Advanced Configuration](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/electron/advanced_configuration.md)
- [Source code for electron-sdk](https://github.com/DataDog/electron-sdk)
- [Explore Datadog RUM](https://docs.datadoghq.com/real_user_monitoring.md)
