# io.Connect Desktop

Source: https://docs.interop.io/insights/signals/metrics/io-connect-desktop/index.html

## Overview

The following sections describe all default platform metrics published by **io.Connect Desktop**, the type of [Instrument](https://opentelemetry.io/docs/specs/otel/metrics/api/#instrument) used for their implementation, and any additional attributes they may have in their data points.

All published metrics have [common resource attributes](https://docs.interop.io/insights/signals/overview/index.md#common_resource_attributes) and [common metrics attributes](https://docs.interop.io/insights/signals/metrics/overview/index.md#common_metrics_attributes).

> ℹ️ *For details on the structure of the metrics payloads and the attributes common to all metrics, see the [Metrics > Overview](https://docs.interop.io/insights/signals/metrics/overview/index.md) section.*

> ℹ️ *For details on configuring the default platform metrics in **io.Connect Desktop**, see the [Configuration > io.Connect Desktop](https://docs.interop.io/insights/configuration/io-connect-desktop/index.md) section.*

## System

The following sections describe the available metrics related to system performance.

### system_cpu

> ⚠️ *Note that this metric is available only in **io.Connect Desktop**.*

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `ObservableGauge` | percent | The CPU usage of the machine and of the platform. |

The metric publishes three separate measurements at every publishing interval - the current system CPU usage, the average system CPU usage, and the average CPU usage of the platform. Use the `"type"` attribute to distinguish between them.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"type"` | Determines whether the metric value reflects the current system CPU usage, the average system CPU usage, or the average platform CPU usage. Possible values for this attribute are `"current_system_cpu"`, `"average_system_cpu"` and `"average_platform_cpu"`. |

### system_memory

> ⚠️ *Note that this metric is available only in **io.Connect Desktop**.*

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `ObservableGauge` | gigabytes | The memory usage of the machine and of the platform. |

The metric publishes three separate measurements at every publishing interval - the free system memory, the used system memory, and the memory used by the platform. Use the `"type"` attribute to distinguish between them.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"type"` | Determines whether the metric value reflects the free system memory, the used system memory, or the used platform memory. Possible values for this attribute are `"free_system_memory"`, `"used_system_memory"` and `"used_platform_memory"`. |

## Platform

The following sections describe the available metrics related to platform performance.

### platform_error

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Counter` | number | The number of platform errors received during each platform session. |

The metric is incremented for every entry logged at `error` level or above in the platform logs.

The metric doesn't carry the error text or any other details about the error in order to avoid publishing attributes with unbounded values. Use the [logs](https://docs.interop.io/insights/signals/logs/index.md) signal if you need the actual error records.

Errors that occur before **io.Insights** has initialized are also counted - the platform keeps track of them and reports them retroactively once the metric starts being published.

### platform_startup

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Gauge` | milliseconds | The time it took to load the io.Connect platform. |

Measures the interval from starting the actual executable file (not the gilding executable) until the entire platform startup sequence has completed, which happens right after the default Global Layout has been restored.

The time spent authenticating the user is subtracted from the measurement, so for users who had to log in, the value will be shorter than the time they actually waited for the platform to start.

Can be configured as a `Histogram`.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"api"` | Version string of the [`@interopio/desktop`](https://www.npmjs.com/package/@interopio/desktop) library. |

## Apps

The following sections describe the available metrics related to app performance.

### app_count

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `UpDownCounter` | number | The number of app instances currently running. |

The metric reflects how many app instances are running at the moment. It's incremented when an app instance is started and decremented when one is stopped.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"application"` | The name of the app within the io.Connect framework for which the `"app_count"` metric was published. |

### app_cpu

> ⚠️ *Note that this metric is available only in **io.Connect Desktop**.*

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `ObservableGauge` | percent | The average percentage of CPU used for the last measured interval. |

This metric is published for all apps running within the io.Connect framework and for the internal platform components. For a component that isn't a regular app instance, the `"applicationInstance"` attribute holds a generated value in the form of `$<platform instance ID>_<process ID>`.

When an instance that has been reported at the previous publishing interval is no longer running, a final value of `0` is published for it.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"application"` | The name of the app within the io.Connect framework for which the `"app_cpu"` metric was published. |
| `"applicationInstance"` | The unique ID of the app instance within the io.Connect framework. |

### app_crash

> ⚠️ *Note that this metric is available only in **io.Connect Desktop**.*

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Counter` | number | The number of times an app crashed during each platform session. |

For web apps, this metric is published when the renderer process is terminated. For native apps, this metric is published when the process is killed, when the process exits with a non-zero exit code, or when the process is terminated due to a fatal error. Use the `"reason"` attribute to determine the cause for the crash.

Besides regular web and native apps, the metric also covers Workspaces App and Web Group App instances.

> ⚠️ *Note that the platform starts tracking an app instance for crashes when the instance is started. Instances that have been started before **io.Insights** is initialized aren't covered by this metric.*

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"application"` | The name of the app within the io.Connect framework for which the `"app_crash"` metric was published. |
| `"reason"` | Describes the reason for the app crash.<br> For web apps, the value of this attribute is derived from the value of the `reason` property of the [`RenderProcessGoneDetails`](https://www.electronjs.org/docs/latest/api/structures/render-process-gone-details) Electron object.<br> For native apps, the value of this attribute can be:<br> - `"crashed"` - when the process exited with a non-zero exit code;<br> - the [signal](https://nodejs.org/api/process.html#process_signal_events) sent to the process - when the process was terminated or killed and the exit event includes a signal;<br> - the message from the error event - when the process couldn't be started or controlled due to a fatal OS-level error; |

### app_duration

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Gauge` | milliseconds | The time an app has been on focus during each platform session. |

Each period on focus is measured separately - when an app loses focus, the duration of that period is recorded as an individual value. All values accumulated since the last export are published at each publishing interval.

The currently focused app isn't reported until it loses focus. Use the `"app_duration_soft"` metric instead if you need the time on focus of an app to be reflected while the app is still focused.

Can be configured as a `Histogram`.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"application"` | The name of the app within the io.Connect framework for which the `"app_duration"` metric was published. |

### app_duration_soft

> ⚠️ *Note that this metric is available only in **io.Connect Desktop**.*

> ⚠️ *Note that this metric is disabled by default. To start publishing it, enable it explicitly in the [metrics configuration](https://docs.interop.io/insights/configuration/io-connect-desktop/index.md#metrics-platform_metrics).*

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Gauge` | milliseconds | The time an app has been on focus during each platform session, including the app that's currently on focus. |

Measures the same intervals as the `"app_duration"` metric, but the currently focused app doesn't have to lose focus in order for its time on focus to be reported - at every publishing interval the ongoing period on focus is closed and published, and a new one is started.

Can be configured as a `Histogram`.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"application"` | The name of the app within the io.Connect framework for which the `"app_duration_soft"` metric was published. |

### app_error

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Counter` | number | The number of app errors received during each platform session. |

For web apps, the metric reports the errors received in the handlers for the `"error"` and `"unhandledrejection"` events. Errors from Workspaces App and Web Group App instances are covered as well.

The metric doesn't carry the error message or any other details about the error in order to avoid publishing attributes with unbounded values. Use the [logs](https://docs.interop.io/insights/signals/logs/index.md) signal if you need the actual error records.

> ⚠️ *Note that the platform starts tracking an app instance for errors when the instance is started. Instances that have been started before **io.Insights** is initialized aren't covered by this metric.*

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"application"` | The name of the app within the io.Connect framework for which the `"app_error"` metric was published. |

### app_memory

> ⚠️ *Note that this metric is available only in **io.Connect Desktop**.*

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `ObservableGauge` | kilobytes | The current memory usage for the last measured interval. |

This metric is published for all apps running within the io.Connect framework and for the internal platform components. For a component that isn't a regular app instance, the `"applicationInstance"` attribute holds a generated value in the form of `$<platform instance ID>_<process ID>`.

When an instance that has been reported at the previous publishing interval is no longer running, a final value of `0` is published for it.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"application"` | The name of the app within the io.Connect framework for which the `"app_memory"` metric was published. |
| `"applicationInstance"` | The unique ID of the app instance within the io.Connect framework. |

### app_started

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Counter` | number | The number of times an app has been started during each platform session. |

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"application"` | The name of the app within the io.Connect framework for which the `"app_started"` metric was published. |

### app_startup

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Gauge` | milliseconds | The time it took to start an app. |

Measures the interval from receiving the request for starting the app until the Interop [`Instance`](https://docs.interop.io/desktop/reference/javascript/interop/instance/index.md) of the app is ready. This applies to both web and native apps.

Can be configured as a `Histogram`.

> ⚠️ *Note that this metric isn't published for apps that don't use the io.Connect libraries, as in this case a reliable signal for completing the app initialization process isn't available.*

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"api"` | Version string of the [`@interopio/desktop`](https://www.npmjs.com/package/@interopio/desktop) library. |
| `"application"` | The name of the app within the io.Connect framework for which the `"app_startup"` metric was published. |

### app_stopped

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Counter` | number | The number of times an app has been stopped during each platform session. |

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"application"` | The name of the app within the io.Connect framework for which the `"app_stopped"` metric was published. |

## Workspaces

The following sections describe the available metrics related to [Workspaces](https://docs.interop.io/desktop/capabilities/windows/workspaces/overview/index.md) performance.

> ⚠️ *Note that the platform doesn't publish metrics related to Workspaces that are dragged out of existing Workspaces App instances or metrics related to Workspaces App instances that are still part of the Frame pool (the [configurable](https://docs.interop.io/desktop/capabilities/windows/workspaces/overview/index.md#extending_workspaces-configuration) pool of cached Workspaces App instances that is used by the platform for improving Workspaces performance and user experience).*

> ⚠️ *Note that if more than one instance of the same Workspace has been loaded (regardless of whether in a new Workspaces App instance or in an already existing one), the `"workspace_startup"`, `"workspace_startup_component"`, and `"workspace_startup_apps"` metrics will show information only about the last loaded instance of the Workspace.*

### workspace_count

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `UpDownCounter` | number | The number of Workspaces currently open. |

This metric reflects how many Workspaces are open at the moment. It's incremented when a Workspace is opened and decremented when it's closed.

Renaming a Workspace is also handled by this metric - the count for the previous Workspace Layout name is decremented and the count for the new one is incremented.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"layout"` | The name of the Workspace for which the metric was published. The value will be `"unknown"` if not tied to a specific Workspace Layout - e.g., in case of creating a new Workspace, or initialization of a Workspaces App instance with multiple Workspaces in it. |

### workspace_selected

Available since io.Connect Desktop 10.4

> ⚠️ *Note that this metric is available only in **io.Connect Desktop**.*

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Counter` | number | The number of times a Workspace has been selected during each platform session. |

The metric is incremented each time a Workspace becomes the selected one - when the user clicks its tab, when it's restored individually or as part of a Global Layout, and when a new Workspace is created.

Renaming the currently selected Workspace also increments the metric, and the value is published under the new Workspace Layout name. Renaming a Workspace that isn't selected doesn't increment the metric.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"layout"` | The name of the Workspace for which the metric was published. The value will be `"unknown"` if not tied to a specific Workspace Layout - e.g., in case of creating a new Workspace, or initialization of a Workspaces App instance with multiple Workspaces in it. |

### workspace_started

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Counter` | number | The number of times a Workspace has been started during each platform session. |

The metric is published against the Workspace Layout name at the moment the Workspace is started. Renaming a Workspace isn't tracked - after a rename, the counts accumulated under the previous name stay as they are and the counts for the new name start from zero.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"layout"` | The name of the Workspace for which the metric was published. The value will be `"unknown"` if not tied to a specific Workspace Layout - e.g., in case of creating a new Workspace, or initialization of a Workspaces App instance with multiple Workspaces in it. |

### workspace_startup

> ⚠️ *Note that this metric is available only in **io.Connect Desktop**.*

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Gauge` | milliseconds | The total time it took to load a Workspace. |

Measures the interval from initiating the request for creating or restoring the Workspace until all visible apps in it have been loaded. For web apps, this means that the `DOMContentLoaded` event has been fired. For native apps, this means that the app has completed its window registration within the io.Connect framework.

This is the root metric for measuring Workspace startup times and it's published in parallel with several sub-metrics that measure the separate intervals for completing the consecutive stages of loading a Workspace. Use the `"includesFrameCreation"` attribute to determine whether the measurement includes the time for initializing a Workspaces App instance.

If the Workspace is created or restored in a new Workspaces App instance, the `"workspace_startup_frame"` metric and its sub-metrics will also be published in parallel with `"workspace_startup"`. The `"workspace_startup_component"` and the `"workspace_startup_apps"` metrics are always published in parallel with `"workspace_startup"` regardless of whether a new Workspaces App instance has been created.

Can be configured as a `Histogram`.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"complexLoad"` |  Differentiates between launching Workspaces in which all apps are loaded as new instances (this is the normal loading scenario, i.e. the value of `"complexLoad"` will be `"false"`), and Workspaces in which one or more of the app windows are already existing windows that have been included in the Workspace (this is the complex loading scenario, i.e. the value of `"complexLoad"` will be `"true"`). If `"complexLoad"` is `"true"`, the time for loading the Workspace may be slightly or significantly decreased and it's important to keep in mind that this won't be due to performance optimizations, but due to loading one or more already existing app instances into the Workspace, which is a faster procedure than starting new app instances. *Available only in **io.Connect Desktop**.* *Available since **io.Connect Desktop** 9.10.* |
| `"includesFrameCreation"` | If the value of this attribute is `"true"`, this means that the measurement includes the time it took to initialize a Workspaces App instance (e.g., if the Workspace has been loaded into an already existing Workspaces App instance, the value of this attribute will be `"false"`). *Available only in **io.Connect Desktop**.* *Available since **io.Connect Desktop** 9.10.* |
| `"layout"` | The name of the Workspace for which the metric was published. The value will be `"unknown"` if not tied to a specific Workspace Layout - e.g., in case of creating a new Workspace, or initialization of a Workspaces App instance with multiple Workspaces in it. |

### workspace_startup_apps

Available since io.Connect Desktop 9.10

> ⚠️ *Note that this metric is available only in **io.Connect Desktop**.*

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Gauge` | milliseconds | The time it took to load all apps in the Workspace. |

Measures the interval from initiating the loading of the first app in the Workspace until all apps have been loaded. For web apps, this means that the `DOMContentLoaded` event has been fired. For native apps, this means that the app has completed its window registration within the io.Connect framework.

Use the `"complexLoad"` attribute to determine whether all apps in the Workspace have been started as new app instances, or one or more of them has been included in the Workspace as an already existing window.

Can be configured as a `Histogram`.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"complexLoad"` |  Differentiates between launching Workspaces in which all apps are loaded as new instances (this is the normal loading scenario, i.e. the value of `"complexLoad"` will be `"false"`), and Workspaces in which one or more of the app windows are already existing windows that have been included in the Workspace (this is the complex loading scenario, i.e. the value of `"complexLoad"` will be `"true"`). If `"complexLoad"` is `"true"`, the time for loading the Workspace may be slightly or significantly decreased and it's important to keep in mind that this won't be due to performance optimizations, but due to loading one or more already existing app instances into the Workspace, which is a faster procedure than starting new app instances. |
| `"includesFrameCreation"` | If the value of this attribute is `"true"`, this means that the measurement includes the time it took to initialize a Workspaces App instance (e.g., if the Workspace has been loaded into an already existing Workspaces App instance, the value of this attribute will be `"false"`). |
| `"layout"` | The name of the Workspace for which the metric was published. The value will be `"unknown"` if not tied to a specific Workspace Layout - e.g., in case of creating a new Workspace, or initialization of a Workspaces App instance with multiple Workspaces in it. |

### workspace_startup_component

Available since io.Connect Desktop 9.10

> ⚠️ *Note that this metric is available only in **io.Connect Desktop**.*

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Gauge` | milliseconds | The time it took to create and render the `<Workspaces />` component within an already existing Workspaces App instance. |

Published when the Workspace is created or restored in an already existing Workspaces App instance. Measures the interval from initiating the initialization of the `<Workspaces />` [component](https://docs.interop.io/desktop/capabilities/windows/workspaces/overview/index.md#extending_workspaces-workspaces_component) inside the Workspaces App instance until the component is fully rendered and interactive.

Can be configured as a `Histogram`.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"complexLoad"` |  Differentiates between launching Workspaces in which all apps are loaded as new instances (this is the normal loading scenario, i.e. the value of `"complexLoad"` will be `"false"`), and Workspaces in which one or more of the app windows are already existing windows that have been included in the Workspace (this is the complex loading scenario, i.e. the value of `"complexLoad"` will be `"true"`). If `"complexLoad"` is `"true"`, the time for loading the Workspace may be slightly or significantly decreased and it's important to keep in mind that this won't be due to performance optimizations, but due to loading one or more already existing app instances into the Workspace which is a faster procedure than starting new app instances. |
| `"includesFrameCreation"` | If the value of this attribute is `"true"`, this means that the measurement includes the time it took to initialize a Workspaces App instance (e.g., if the Workspace has been loaded into an already existing Workspaces App instance, the value of this attribute will be `"false"`). |
| `"layout"` | The name of the Workspace for which the metric was published. The value will be `"unknown"` if not tied to a specific Workspace Layout - e.g., in case of creating a new Workspace, or initialization of a Workspaces App instance with multiple Workspaces in it. |

### workspace_startup_frame

Available since io.Connect Desktop 9.10

> ⚠️ *Note that this metric is available only in **io.Connect Desktop**.*

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Gauge` | milliseconds | The total time it took to load the Workspaces App instance. |

Measures the interval from initiating the request for creating or restoring the Workspace until the Workspaces App instance has been fully loaded and the `<Workspaces />` component has been rendered.

This metric is published only when a new Workspaces App instance is being created and is published in parallel with the following sub-metrics that measure the separate intervals for completing the consecutive stages of initializing a Workspaces App instance: `"workspace_startup_frame_init"`, `"workspace_startup_frame_page_load"`, and `"workspace_startup_frame_workspace_render"`.

Can be configured as a `Histogram`.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"complexLoad"` |  Differentiates between launching Workspaces in which all apps are loaded as new instances (this is the normal loading scenario, i.e. the value of `"complexLoad"` will be `"false"`), and Workspaces in which one or more of the app windows are already existing windows that have been included in the Workspace (this is the complex loading scenario, i.e. the value of `"complexLoad"` will be `"true"`). If `"complexLoad"` is `"true"`, the time for loading the Workspace may be slightly or significantly decreased and it's important to keep in mind that this won't be due to performance optimizations, but due to loading one or more already existing app instances into the Workspace, which is a faster procedure than starting new app instances. |
| `"includesFrameCreation"` | If the value of this attribute is `"true"`, this means that the measurement includes the time it took to initialize a Workspaces App instance (e.g., if the Workspace has been loaded into an already existing Workspaces App instance, the value of this attribute will be `"false"`). |
| `"layout"` | The name of the Workspace for which the metric was published. The value will be `"unknown"` if not tied to a specific Workspace Layout - e.g., in case of creating a new Workspace, or initialization of a Workspaces App instance with multiple Workspaces in it. |

### workspace_startup_frame_init

Available since io.Connect Desktop 9.10

> ⚠️ *Note that this metric is available only in **io.Connect Desktop**.*

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Gauge` | milliseconds | The time it took to create the browser window for the Workspaces App instance. |

Published in parallel with the `"workspace_startup_frame"` metric. Measures the interval from initiating the creation of the underlying browser window until the browser window is ready for loading the web page of the Workspaces App instance.

Can be configured as a `Histogram`.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"complexLoad"` |  Differentiates between launching Workspaces in which all apps are loaded as new instances (this is the normal loading scenario, i.e. the value of `"complexLoad"` will be `"false"`), and Workspaces in which one or more of the app windows are already existing windows that have been included in the Workspace (this is the complex loading scenario, i.e. the value of `"complexLoad"` will be `"true"`). If `"complexLoad"` is `"true"`, the time for loading the Workspace may be slightly or significantly decreased and it's important to keep in mind that this won't be due to performance optimizations, but due to loading one or more already existing app instances into the Workspace, which is a faster procedure than starting new app instances. |
| `"includesFrameCreation"` | If the value of this attribute is `"true"`, this means that the measurement includes the time it took to initialize a Workspaces App instance (e.g., if the Workspace has been loaded into an already existing Workspaces App instance, the value of this attribute will be `"false"`). |
| `"layout"` | The name of the Workspace for which the metric was published. The value will be `"unknown"` if not tied to a specific Workspace Layout - e.g., in case of creating a new Workspace, or initialization of a Workspaces App instance with multiple Workspaces in it. |

### workspace_startup_frame_page_load

Available since io.Connect Desktop 9.10

> ⚠️ *Note that this metric is available only in **io.Connect Desktop**.*

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Gauge` | milliseconds | The time it took to load the web page of the Workspaces App instance. |

Published in parallel with the `"workspace_startup_frame"` metric. Measures the interval from initiating the navigation to the web page of the Workspaces App instance (after the underlying browser window has been created) until the `DOMContentLoaded` event is fired for the web page.

Can be configured as a `Histogram`.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"complexLoad"` |  Differentiates between launching Workspaces in which all apps are loaded as new instances (this is the normal loading scenario, i.e. the value of `"complexLoad"` will be `"false"`), and Workspaces in which one or more of the app windows are already existing windows that have been included in the Workspace (this is the complex loading scenario, i.e. the value of `"complexLoad"` will be `"true"`). If `"complexLoad"` is `"true"`, the time for loading the Workspace may be slightly or significantly decreased and it's important to keep in mind that this won't be due to performance optimizations, but due to loading one or more already existing app instances into the Workspace, which is a faster procedure than starting new app instances. |
| `"includesFrameCreation"` | If the value of this attribute is `"true"`, this means that the measurement includes the time it took to initialize a Workspaces App instance (e.g., if the Workspace has been loaded into an already existing Workspaces App instance, the value of this attribute will be `"false"`). |
| `"layout"` | The name of the Workspace for which the metric was published. The value will be `"unknown"` if not tied to a specific Workspace Layout - e.g., in case of creating a new Workspace, or initialization of a Workspaces App instance with multiple Workspaces in it. |

### workspace_startup_frame_workspace_render

Available since io.Connect Desktop 9.10

> ⚠️ *Note that this metric is available only in **io.Connect Desktop**.*

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Gauge` | milliseconds | The time it took to render the `<Workspaces />` component in a newly created Workspaces App instance. |

Published in parallel with the `"workspace_startup_frame"` metric. Measures the interval from initiating the initialization of the `<Workspaces />` component inside the Workspaces App instance (after the web page of the Workspaces App instance has already been loaded) until the component is fully rendered and interactive.

Can be configured as a `Histogram`.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"complexLoad"` |  Differentiates between launching Workspaces in which all apps are loaded as new instances (this is the normal loading scenario, i.e. the value of `"complexLoad"` will be `"false"`), and Workspaces in which one or more of the app windows are already existing windows that have been included in the Workspace (this is the complex loading scenario, i.e. the value of `"complexLoad"` will be `"true"`). If `"complexLoad"` is `"true"`, the time for loading the Workspace may be slightly or significantly decreased and it's important to keep in mind that this won't be due to performance optimizations, but due to loading one or more already existing app instances into the Workspace, which is a faster procedure than starting new app instances. |
| `"includesFrameCreation"` | If the value of this attribute is `"true"`, this means that the measurement includes the time it took to initialize a Workspaces App instance (e.g., if the Workspace has been loaded into an already existing Workspaces App instance, the value of this attribute will be `"false"`). |
| `"layout"` | The name of the Workspace for which the metric was published. The value will be `"unknown"` if not tied to a specific Workspace Layout - e.g., in case of creating a new Workspace, or initialization of a Workspaces App instance with multiple Workspaces in it. |

### workspace_stopped

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Counter` | number | The number of times a Workspace has been stopped during each platform session. |

The metric is published against the Workspace Layout name at the moment the Workspace is stopped. Renaming a Workspace isn't tracked - after a rename, the counts accumulated under the previous name stay as they are and the counts for the new name start from zero.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"layout"` | The name of the Workspace for which the metric was published. The value will be `"unknown"` if not tied to a specific Workspace Layout - e.g., in case of creating a new Workspace, or initialization of a Workspaces App instance with multiple Workspaces in it. |

## Layouts

The following sections describe the available metrics related to [Global Layouts](https://docs.interop.io/desktop/capabilities/windows/layouts/overview/index.md) performance.

### layout_startup

| Instrument Type | Unit | Description |
|-----------------|------|-------------|
| `Gauge` | milliseconds | The time it took to restore a Global Layout. |

Measures the interval from initiating the operation for restoring the Global Layout until all its components (individual windows, window groups, Workspaces) have completed loading. A component is considered completed when it has loaded successfully, has failed, or has timed out, so a Global Layout in which some of the components have failed to start will still produce a measurement.

When the platform displays a confirmation dialog before restoring the Global Layout, the measurement starts after the user confirms the operation.

Can be configured as a `Histogram`.

Additional attributes:

| Attribute | Description |
|-----------|-------------|
| `"layout"` | The name of the Global Layout for which the `"layout_startup"` metric was published. |

## Custom Metrics

Available since io.Connect Desktop 10.1

> ⚠️ *Note that custom metrics are currently available only in **io.Connect Desktop**.*

The following table lists the available custom metrics that can be published via the [Insights API](https://docs.interop.io/insights/insights-api/javascript/index.md):

| Metric | Instrument Type | Description |
|--------|-----------------|-------------|
| `"custom_counter"` | `Counter` | A monotonically increasing counter that tracks cumulative totals. Use the `add()` method to increment the metric value by a given amount. |
| `"custom_gauge"` | `Gauge` | A point-in-time measurement that records the current value. Use the `record()` method to report the current measurement. |
| `"custom_histogram"` | `Histogram` | A distribution of measurements aggregated into configurable buckets. Use the `record()` method to capture individual measurements. |
| `"custom_observable_counter"` | `ObservableCounter` | Asynchronous monotonically increasing counter. The OpenTelemetry SDK periodically invokes a provided callback to collect the current cumulative total. |
| `"custom_observable_gauge"` | `ObservableGauge` | Asynchronous point-in-time measurement. The OpenTelemetry SDK periodically invokes a provided callback to collect the current value. |
| `"custom_observable_up_down_counter"` | `ObservableUpDownCounter` | Asynchronous bidirectional counter. The OpenTelemetry SDK periodically invokes a provided callback to collect a cumulative value that can increase or decrease. |
| `"custom_up_down_counter"` | `UpDownCounter` | A bidirectional counter that tracks quantities which can go up and down. Use the `add()` method with positive or negative values. |
