# io.Connect Browser

Source: https://docs.interop.io/insights/signals/traces/io-connect-browser/index.html

## Overview

Available since io.Connect Browser 5.0

The following sections describe the default trace instrumentations provided by **io.Insights** for the **io.Connect Browser** platform ([`@interopio/browser-platform`](https://www.npmjs.com/package/@interopio/browser-platform)), the [`@interopio/browser`](https://www.npmjs.com/package/@interopio/browser) library used by the Main app and the Browser Clients, and the Workspaces App ([`@interopio/workspaces-ui-react`](https://www.npmjs.com/package/@interopio/workspaces-ui-react)).

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

Spans are created only when the corresponding operation runs and the respective instrumentation and span filters allow it. Enabling traces doesn't cause every listed span to be published.

Creating and restoring Workspaces is traced as a single operation across all participating apps. The Workspaces API call in the calling app ([`interopio.api.workspaces`](#interopiobrowser-interopioapiworkspaces)), the platform operations ([`interopio.browser.workspaces`](#platform-interopiobrowserworkspaces)), the operations of the Workspaces App ([`interopio.workspaces.frame`](#interopioworkspacesuireact-interopioworkspacesframe)), and the registration of the apps started in the Workspace ([`interopio.browser.appManager`](#platform-interopiobrowserappmanager), [`interopio.browser.windows`](#platform-interopiobrowserwindows)) are linked in one trace. The [Workspace startup metrics](https://docs.interop.io/insights/signals/metrics/io-connect-browser/index.md#workspaces-workspacestartup) measure the overall startup and its individual stages - use the metrics to compare durations across sessions, and the traces to examine the operations in an individual execution.

> ℹ️ *For details on the trace payload structure, span sources, and the conventions used for describing the span attributes, see the [Traces > Overview](https://docs.interop.io/insights/signals/traces/overview/index.md) section.*

> ℹ️ *For details on configuring traces in **io.Connect Browser**, see the [Configuration > io.Connect Browser](https://docs.interop.io/insights/configuration/io-connect-browser/index.md#traces) section.*

## Platform

The **io.Connect Browser** platform publishes traces related to the platform operations. All spans related to the platform are prefixed with `"interopio.browser"`.

### Common Span Attributes

All spans created by the **io.Connect Browser** platform have the following common span attributes:

| Attribute | Type | Description |
|----------|------|-------------|
| `platformVersion` | `string` | The version of the platform (e.g., `"5.0.0"`). |

Each span may also have additional attributes. These span-specific attributes are described in the respective span sub-sections.

### interopio.browser.appManager

Traces related to app lifecycle events on the platform level.

#### interopio.browser.appManager.registerWorkspaceApp

Traces registering an app instance started in a Workspace. Part of the Workspace trace.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `appName` | `string` | - | Name of the app. Can be used in the span filtering context. |
| `commandId` | `string` | - | ID correlating the platform command. Can be used in the span filtering context. |
| `windowId` | `string` | - | ID of the window. Can be used in the span filtering context. |

### interopio.browser.windows

Traces related to window events on the platform level.

#### interopio.browser.windows.registerWorkspaceWindow

Traces registering a window started in a Workspace. Part of the Workspace trace.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `commandId` | `string` | - | ID correlating the platform command. Can be used in the span filtering context. |
| `windowId` | `string` | - | ID of the window. Can be used in the span filtering context. |

### interopio.browser.workspaces

Traces related to Workspace operations on the platform level. By default, the spans for creating and restoring a Workspace can start a new trace, while other spans of the platform can only be part of an existing trace.

#### interopio.browser.workspaces.createWorkspace

Traces the platform operation for creating a Workspace.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `commandId` | `string` | - | ID correlating the platform command. Can be used in the span filtering context. |
| `reuseFrameId` | `string` | - | ID of the Workspaces App instance to reuse. Can be used in the span filtering context. |

#### interopio.browser.workspaces.openFrame

Traces opening a Workspaces App instance.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `frameId` | `string` | - | ID of the Workspaces App instance. Can be used in the span filtering context. |
| `layoutComponentId` | `string` | - | ID of the Layout component. Can be used in the span filtering context. |

#### interopio.browser.workspaces.openWorkspace

Traces the platform operation for restoring a Workspace Layout.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `commandId` | `string` | - | ID correlating the platform command. Can be used in the span filtering context. |
| `layoutName` | `string` | - | Name of the Workspace Layout. Can be used in the span filtering context. |
| `restoreFrameId` | `string` | - | ID of the Workspaces App instance in which to restore the Workspace. Can be used in the span filtering context. |
| `restoreLoadingStrategy` | `string` | - | Loading strategy requested for the restored Workspace. Can be used in the span filtering context. |

## @interopio/browser

The [`@interopio/browser`](https://www.npmjs.com/package/@interopio/browser) library publishes traces related to the library operations and API usage in the Main app and in the Browser Clients. All spans related to the library are prefixed with `"interopio.api"`.

### Common Span Attributes

All spans from the `@interopio/browser` library have the following common span attributes:

| Attribute | Type | Description |
|----------|------|-------------|
| `platformVersion` | `string` | The version of the platform (e.g., `"5.0.0"`). |

The app, the library versions, and the window publishing the span are identified by the [resource attributes](https://docs.interop.io/insights/signals/overview/index.md#common_resource_attributes-ioconnect_browser). They are included in the span attributes only if the resource-level attributes are configured to be merged with the data point attributes.

Each span may also have additional attributes. These span-specific attributes are described in the respective span sub-sections.

### interopio.api

Top-level library spans.

#### interopio.api.startup

Traces the library initialization from the point at which **io.Insights** has been initialized until the io.Connect library is ready.

### interopio.api.appManager

Traces related to using the App Management API accessible via the [`io.appManager`](https://docs.interop.io/browser/reference/javascript/app%20management/api/index.md) object.

#### interopio.api.appManager.application.start

Traces the execution of the `application.start()` method.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `appName` | `string` | - | Name of the app. Can be used in the span filtering context. |
| `context` | `object` | `DIAGNOSTIC` | The starting context of the instance. |
| `options` | `object` | `DEBUG` | Options for starting the app instance. |

### interopio.api.appStartup

Spans published by the [app startup instrumentation](https://docs.interop.io/insights/configuration/io-connect-browser/index.md#traces-auto_instrumentation-app_startup), which is enabled by default when traces are enabled. The startup trace describes the loading of the app page and its initialization. The separate [`interopio.api.startup`](#interopiobrowser-interopioapi) span describes only the initialization of the io.Connect library.

The operations traced during the startup window are nested under the `interopio.api.appStartup` root span and have the `isStartup` attribute in their filtering context. The startup window can also contain the error, resource, and event loop blocking spans described in [interopio.api.instrumentation](#interopiobrowser-interopioapiinstrumentation). If the respective instrumentation is enabled, it publishes these spans instead, so the same events aren't recorded twice.

#### interopio.api.appStartup

Root span of the app startup trace. Its duration and the interval during which other operations are nested under it are determined by the startup configuration. Carries the available navigation, paint, Web Vitals, long task, and lifecycle measurements for the startup.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `isStartup` | `boolean` | - | Identifies the operations recorded during the startup window. |
| `startupFinishedType` | `string` | `INFO` | Event or condition that ended the startup. |
| `startupWindowClosedBy` | `string` | `INFO` | Condition that closed the startup window, if it differs from the end of the root span. |

#### interopio.api.appStartup.&lt;lifecycle-event&gt;

Child spans recording the page lifecycle events observed during the startup window. Published when lifecycle observation is enabled. The following spans are available:

| Span | Description |
|------|-------------|
| `interopio.api.appStartup.freeze` | The page has been frozen. |
| `interopio.api.appStartup.pageHide` | A `pagehide` event. The `persisted` attribute shows whether the page enters the back/forward cache. |
| `interopio.api.appStartup.pageShow` | A `pageshow` event. The `persisted` attribute shows whether the page has been restored from the back/forward cache. |
| `interopio.api.appStartup.prerenderingChange` | The document has left prerendering. |
| `interopio.api.appStartup.resume` | The page has been resumed. |
| `interopio.api.appStartup.visibilityChange` | A visibility change. Includes the `visibilityState` attribute. |

#### interopio.api.appStartup.navigation.&lt;phase&gt;

Child spans describing the phases of loading the document. Published when navigation tracing is enabled. Only the phases with available and valid timing information are published. The following phases are available:

| Phase | Description |
|-------|-------------|
| `connect` | Establishing the connection. |
| `contentLoadedHandlers` | Executing the `DOMContentLoaded` handlers. |
| `deferredScripts` | Executing the deferred scripts before `DOMContentLoaded`. |
| `dns` | Resolving the server address. |
| `domParsing` | Parsing the document. |
| `loadHandlers` | Executing the window `load` handlers. |
| `previousPageUnload` | Unloading the previous document. |
| `redirect` | Following navigation redirects. |
| `request` | Sending the request and waiting for the first response byte. |
| `response` | Receiving the document response. |
| `serviceWorkerStartup` | Starting the Service Worker for the navigation. |
| `subresources` | Waiting for subresources before the `load` event. |
| `tls` | Negotiating the secure connection. |

#### interopio.api.appStartup.paint

Records a `first-paint` or `first-contentful-paint` mark. Published when paint observation is enabled.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `paint` | `string` | - | Name of the paint mark. |

#### interopio.api.appStartup.windowLoad

Measures the interval from the start of the navigation until the window `load` event has completed. Published when navigation timing is available and navigation tracing is enabled.

### interopio.api.bus

Traces related to using the Pub/Sub API. These spans require the optional Pub/Sub module to be enabled.

#### interopio.api.bus.publish

Traces when data is published via Pub/Sub.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `data` | `object` | `DIAGNOSTIC` | The data being pushed. |
| `routingKey` | `string` | `INFO` | Routing key for the publish operation. |
| `target` | `object` | `INFO` | Target for the publish operation. |
| `topic` | `string` | `INFO` | The topic being pushed to. Can be used in the span filtering context. |

#### interopio.api.bus.subscribe

Traces when a client subscribes to a topic.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `routingKey` | `string` | `INFO` | Routing key for the subscription. |
| `subscription_id` | `string` | `INFO` | Subscription ID. |
| `target` | `object` | `INFO` | Target for the subscription. |
| `topic` | `string` | `INFO` | The topic being subscribed to. Can be used in the span filtering context. |

#### interopio.api.bus.subscribe.callback

Traces when a subscribed topic receives data.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `data` | `object` | `DIAGNOSTIC` | The data received. |
| `subscription_id` | `string` | `INFO` | Subscription ID. |
| `topic` | `string` | `INFO` | The topic subscribed to. Can be used in the span filtering context. |

### interopio.api.clickstream

Spans published by the [Click Stream](https://docs.interop.io/insights/configuration/io-connect-browser/index.md#traces-click_stream) trace, which is enabled by default when traces are enabled. The `<app_name>` part of the span sources is omitted when the `descriptiveName` property of the Click Stream configuration is set to `false`. The configured structure determines whether the successive event spans are siblings or are nested under each other.

#### interopio.api.clickstream.&lt;app_name&gt;.start

Starts the Click Stream trace and provides the initial parent span for the event spans.

#### interopio.api.clickstream.&lt;app_name&gt;.&lt;event&gt;

A captured DOM event (e.g., `click`, `dblclick`). Includes details about the event and the target element.

#### interopio.api.clickstream.&lt;app_name&gt;.&lt;event&gt;.listener

Execution of a listener for the captured event. Only listeners registered via `addEventListener()` after the io.Connect library has been initialized are captured.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `eventName` | `string` | - | Name of the DOM event. Can be used in the span filtering context. |

### interopio.api.contexts

Traces related to using the Shared Contexts API accessible via the [`io.contexts`](https://docs.interop.io/browser/reference/javascript/shared%20contexts/api/index.md) object. Both the API operation and its underlying context operation can create spans.

#### interopio.api.contexts.bridge.create

Traces when a shared context is created.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `context` | `string` | - | Name of the shared context. Can be used in the span filtering context. |
| `data` | `string` | `DIAGNOSTIC` | JSON representation of the context data. |
| `dataBytes` | `number` | `DEBUG` | Size of the serialized context data in bytes. |
| `dataKeyCount` | `number` | `INFO` | Number of context data keys. |
| `dataKeys` | `string[]` | `DEBUG` | Names of the context data keys. |

#### interopio.api.contexts.bridge.destroy

Traces when a shared context is destroyed.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `context` | `string` | `INFO` | Name of the shared context being destroyed. Can be used in the span filtering context. |

#### interopio.api.contexts.bridge.get

Traces when a shared context is retrieved using the `get()` method.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `context` | `string` | `INFO` | Name of the shared context. Can be used in the span filtering context. |

#### interopio.api.contexts.bridge.set

Traces when a shared context is replaced using the `set()` method.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `context` | `string` | - | Name of the shared context. Can be used in the span filtering context. |
| `data` | `string` | `DIAGNOSTIC` | JSON representation of the context data. |
| `dataBytes` | `number` | `DEBUG` | Size of the serialized context data in bytes. |
| `dataKeyCount` | `number` | `INFO` | Number of context data keys. |
| `dataKeys` | `string[]` | `DEBUG` | Names of the context data keys. |

#### interopio.api.contexts.bridge.setPaths

Traces when paths in a shared context are updated using the `setPath()` or `setPaths()` methods.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `context` | `string` | - | Name of the shared context. Can be used in the span filtering context. |
| `pathCount` | `number` | `INFO` | Number of paths supplied for the update. |
| `paths` | `string[]` | `DEBUG` | Paths supplied for the update. |
| `pathValueBytes` | `number` | `DEBUG` | Size of the serialized path/value entries in bytes. |
| `pathValues` | `string` | `DIAGNOSTIC` | JSON representation of the path/value entries. |

#### interopio.api.contexts.bridge.subscribe

Traces when a shared context is being subscribed to using the `subscribe()` method.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `context` | `string` | `INFO` | Name of the shared context subscribed to. Can be used in the span filtering context. |
| `contextExists` | `boolean` | `INFO` | Whether the shared context exists at the time of subscription. |

#### interopio.api.contexts.bridge.subscribe.callback

Traces when a subscribed callback is invoked. The callback span continues the trace of the update when propagation information is available. The update payload is recorded by the [`interopio.api.contexts.bridge.updated`](#interopiobrowser-interopioapicontexts-interopioapicontextsbridgeupdated) span.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `context` | `string` | - | Name of the shared context. Can be used in the span filtering context. |

#### interopio.api.contexts.bridge.update

Traces an update sent to the shared context. The attributes describe the delta sent to the io.Connect Gateway.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `context` | `string` | - | Name of the shared context. Can be used in the span filtering context. |
| `delta` | `string` | `DIAGNOSTIC` | JSON representation of the delta. |
| `deltaBytes` | `number` | `DEBUG` | Size of the serialized delta in bytes. |
| `deltaKeyCount` | `number` | `INFO` | Number of keys changed by the delta. |
| `deltaKeys` | `string[]` | `DEBUG` | Keys changed by the delta. |

#### interopio.api.contexts.bridge.updated

Traces a context update received from the io.Connect Gateway before the subscribed callbacks are invoked. Includes the resulting context and the changes made by the update.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `context` | `string` | - | Name of the shared context. Can be used in the span filtering context. |
| `data` | `string` | `DIAGNOSTIC` | JSON representation of the context data. |
| `dataBytes` | `number` | `DEBUG` | Size of the serialized context data in bytes. |
| `dataKeyCount` | `number` | `INFO` | Number of context data keys. |
| `dataKeys` | `string[]` | `DEBUG` | Names of the context data keys. |
| `delta` | `string` | `DIAGNOSTIC` | JSON representation of the changes. |
| `deltaBytes` | `number` | `DEBUG` | Size of the serialized changes in bytes. |
| `deltaKeyCount` | `number` | `INFO` | Number of changed keys. For a received snapshot, this field is calculated only at `DEBUG` verbosity or higher. |
| `deltaKeys` | `string[]` | `DEBUG` | Keys changed by the update. |
| `removed` | `string[]` | `DEBUG` | Keys removed by the update. |

#### interopio.api.contexts.module.destroy

Similar to its `interopio.api.contexts.bridge.*` counterpart, but also includes some argument checks, which can be captured as errors.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `context` | `string` | - | Name of the shared context. Can be used in the span filtering context. |

#### interopio.api.contexts.module.set

Similar to its `interopio.api.contexts.bridge.*` counterpart, but also includes some argument checks, which can be captured as errors.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `context` | `string` | - | Name of the shared context. Can be used in the span filtering context. |

#### interopio.api.contexts.module.setPaths

Similar to its `interopio.api.contexts.bridge.*` counterpart, but also includes some argument checks, which can be captured as errors.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `context` | `string` | - | Name of the shared context. Can be used in the span filtering context. |

#### interopio.api.contexts.module.subscribe

Similar to its `interopio.api.contexts.bridge.*` counterpart, but also includes some argument checks, which can be captured as errors.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `context` | `string` | - | Name of the shared context. Can be used in the span filtering context. |

#### interopio.api.contexts.module.update

Similar to its `interopio.api.contexts.bridge.*` counterpart, but also includes some argument checks, which can be captured as errors.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `context` | `string` | - | Name of the shared context. Can be used in the span filtering context. |

### interopio.api.instrumentation

Spans published by the [auto instrumentation](https://docs.interop.io/insights/configuration/io-connect-browser/index.md#traces-auto_instrumentation) of web apps. Each instrumentation is enabled individually in the `traces` object of the `insights` configuration object. The available measurements depend on the browser support for the respective performance entry types.

#### interopio.api.instrumentation.errors.error

Records an uncaught error. Published when error instrumentation or startup error observation is enabled. The span has an error status and records the available error details.

#### interopio.api.instrumentation.errors.unhandledRejection

Records an unhandled `Promise` rejection. Published when error instrumentation or startup error observation is enabled. The span has an error status and records the available rejection details.

#### interopio.api.instrumentation.eventLoop.session

Parent span of the event loop spans for the page session. Carries the totals of the observed input delays and main thread blocking as attributes. Published when event loop instrumentation is enabled.

#### interopio.api.instrumentation.eventLoopBlocking

Records a long animation frame or, where unavailable, a long task blocking the main thread. The available timing and script attribution depend on the browser support. Published when event loop instrumentation or startup long task observation is enabled.

#### interopio.api.instrumentation.fetch

Traces a `fetch()` request. Published when request instrumentation is enabled. By default, the exported span is named by the HTTP request method (e.g., `GET`), according to the OpenTelemetry semantic conventions for HTTP client spans. The span filters match the span by its `interopio.api.instrumentation.fetch` source regardless of its name.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `http.request.method` | `string` | - | HTTP request method. |
| `http.response.status_code` | `number` | `INFO` | Response status, if available. |
| `url` | `string` | - | Request URL. Can be used in the span filtering context. |

#### interopio.api.instrumentation.inputDelay

Records a slow input interaction from its event timestamp until the next paint. Includes the element the user interacted with, if available. Published when event loop instrumentation is enabled.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `eventType` | `string` | - | Type of the input event. |
| `inputDelayMs` | `number` | - | Delay before the event processing in milliseconds. |
| `interactionId` | `number` | - | Interaction ID, if available. |
| `presentationDelayMs` | `number` | - | Delay from the completion of the event processing until the presentation in milliseconds. |
| `processingMs` | `number` | - | Time spent processing the event in milliseconds. |

#### interopio.api.instrumentation.navigation

Records an in-page navigation caused by `history.pushState()`, `history.replaceState()`, `popstate`, or `hashchange`. Changes that retain the same URL aren't recorded. Published when navigation instrumentation is enabled.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `from` | `string` | - | Previous URL. |
| `navigationType` | `string` | - | Navigation operation or event. |
| `url` | `string` | - | Destination URL. |
| `url.full` | `string` | - | Destination URL using the OpenTelemetry attribute name. |

#### interopio.api.instrumentation.resource

Records a resource load (e.g., a script, a stylesheet, an image, a font) with the available resource timing information. By default, the resources loaded via `fetch()` and `XMLHttpRequest` are excluded, as the request instrumentation covers them in more detail. Published when resource instrumentation is enabled, or for the slowest resource loads during the startup window when navigation tracing is enabled.

#### interopio.api.instrumentation.webSocket.connect

Records the WebSocket connection attempt from the construction of the WebSocket until it opens or fails. Includes the connection target and timing information. Published when WebSocket instrumentation is enabled.

#### interopio.api.instrumentation.webSocket.lifetime

Records the WebSocket connection from its construction until it closes. Includes the totals of the sent and received messages and bytes, and the available close information. By default, it starts a separate trace linked to the span during which the connection was opened, so that a long-lived connection doesn't extend the initiating trace. Published when WebSocket instrumentation is enabled.

#### interopio.api.instrumentation.webVitals

Records the available CLS, INP, and LCP values when the page becomes hidden and the recorded values have changed. The available measurements depend on the browser support. Published when Web Vitals instrumentation is enabled.

#### interopio.api.instrumentation.webVitals.session

Parent span of the Web Vitals spans for the page session. Published when Web Vitals instrumentation is enabled.

#### interopio.api.instrumentation.xhr

Traces an `XMLHttpRequest` request. Published when request instrumentation is enabled. By default, the exported span is named by the HTTP request method (e.g., `GET`), according to the OpenTelemetry semantic conventions for HTTP client spans. The span filters match the span by its `interopio.api.instrumentation.xhr` source regardless of its name.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `http.request.method` | `string` | - | HTTP request method. |
| `http.response.status_code` | `number` | `INFO` | Response status, if available. |
| `url` | `string` | - | Request URL. Can be used in the span filtering context. |

### interopio.api.interop

Traces related to using the Interop API accessible via the [`io.interop`](https://docs.interop.io/browser/reference/javascript/interop/api/index.md) object.

#### interopio.api.interop.invoke

Traces the invocation of an Interop method (e.g., via the `io.interop.invoke()` API).

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `additionalOptions` | [`InvokeOptions`](https://docs.interop.io/browser/reference/javascript/interop/invokeoptions/index.md) | `INFO` | Object for the invocation options. |
| `arguments` | `object` | `DIAGNOSTIC` | Arguments passed to the invoked method. |
| `error.type` | `string` | `INFO` | `MethodNotFound` when no matching method becomes available before the wait timeout. |
| `method` | `string` | `INFO` | Name of the method. Can be used in the span filtering context. |
| `target` | [`InstanceTarget`](https://docs.interop.io/browser/reference/javascript/interop/instancetarget/index.md) | `INFO` | Target of the invocation. |
| `waitedMs` | `number` | `INFO` | Configured wait timeout in milliseconds when the method isn't found. |

#### interopio.api.interop.invoke.server

Traces the invocation of an Interop method for each specific server that gets invoked.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `error.type` | `string` | `INFO` | Failure category: `InvocationError`, `InvocationTimeout`, or `Unknown`. |
| `instance` | `object` | `INFO` | Instance object of the invoked server. |
| `invocationId` | `string` | `INFO` | ID of the current invocation. |
| `method` | `string` | `INFO` | Name of the method. Can be used in the span filtering context. |
| `returnValue` | `object` | `DIAGNOSTIC` | Return object from the method invocation. |
| `server` | `string` | `INFO` | ID of the invoked server. |
| `timeoutMs` | `number` | `INFO` | Invocation timeout in milliseconds when the invocation times out. |

#### interopio.api.interop.method.update

Traces an update to the definition of an already registered Interop method via `io.interop.updateMethod()`.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `method` | `string` | - | Name of the method. Can be used in the span filtering context. |

#### interopio.api.interop.register

Traces the registration of an Interop method (e.g., via the `io.interop.register()` API).

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `method` | `string` | `INFO` | Name of the method. Can be used in the span filtering context. |

#### interopio.api.interop.register.async

Traces the async registration of an Interop method (e.g., via the `io.interop.registerAsync()` API).

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `method` | `string` | `INFO` | Name of the method. Can be used in the span filtering context. |

#### interopio.api.interop.register.callback

Traces the execution of an Interop method on the server side (e.g., when invoked via the `io.interop.invoke()` API).

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `arguments` | `object` | `DIAGNOSTIC` | Arguments passed to the executed method. |
| `invocationId` | `string` | `INFO` | ID of the current invocation. |
| `invoker` | `object` | `INFO` | Instance object of the invoking peer. |
| `method` | `string` | `INFO` | Name of the method. Can be used in the span filtering context. |
| `returnValue` | `object` | `DIAGNOSTIC` | Return object from the method invocation. |

#### interopio.api.interop.stream.close

Traces the closing of an Interop stream (e.g., using the `stream.close()` API).

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `stream` | `string` | `INFO` | Name that identifies the stream being closed. Can be used in the span filtering context. |

#### interopio.api.interop.stream.create

Traces the registration of an Interop stream (e.g., using the `io.interop.createStream()` API).

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `stream` | `string` | `INFO` | Name of the stream. Can be used in the span filtering context. |

#### interopio.api.interop.stream.onData

Traces the reception of data by an Interop stream subscription before its registered `onData()` handlers are invoked.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `data` | `object` | `DIAGNOSTIC` | Received stream message, including the data payload and stream metadata. |
| `handlerCount` | `number` | `INFO` | Number of subscribed handlers. |
| `method` | `string` | `INFO` | Name that identifies the stream (same as `stream`). Can be used in the span filtering context. |
| `stream` | `string` | `INFO` | Name that identifies the stream (same as `method`). Can be used in the span filtering context. |

#### interopio.api.interop.stream.push

Traces the pushing of data to an Interop stream (e.g., using the `stream.push()` API).

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `branches` | `string` \| `string[]` | `INFO` | Branches that are being pushed to. |
| `data` | `object` | `DIAGNOSTIC` | Data being pushed. |
| `stream` | `string` | `INFO` | Name that identifies the stream. Can be used in the span filtering context. |

#### interopio.api.interop.stream.subscribe

Traces the subscription to an Interop stream (e.g., using the `io.interop.subscribe()` API).

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `options` | `object` | `INFO` | Subscription parameters object. |
| `stream` | `string` | `INFO` | Name of the stream. Can be used in the span filtering context. |

#### interopio.api.interop.unregister

Traces the unregistration of an Interop method (e.g., via the `io.interop.unregister()` API).

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `method` | `string` | `INFO` | Name of the method. Can be used in the span filtering context. |

### interopio.api.layouts

Traces related to using the Layouts API accessible via the [`io.layouts`](https://docs.interop.io/browser/reference/javascript/layouts/api/index.md) object.

#### interopio.api.layouts.restore

Traces the execution of the `io.layouts.restore()` method.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `layoutName` | `string` | - | Name of the Layout. Can be used in the span filtering context. |
| `options` | `object` | `DEBUG` | Options for restoring the Layout. |

### interopio.api.windows

Traces related to using the Window Management API accessible via the [`io.windows`](https://docs.interop.io/browser/reference/javascript/windows/api/index.md) object.

#### interopio.api.windows.open

Traces the execution of the `io.windows.open()` method.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `url` | `string` | `INFO` | URL loaded in the new window. |
| `windowName` | `string` | `INFO` | Name of the new window. |

### interopio.api.workspaces

Traces related to using the Workspaces API accessible via the [`io.workspaces`](https://docs.interop.io/browser/reference/javascript/workspaces/api/index.md) object. These spans are published by the [`@interopio/workspaces-api`](https://www.npmjs.com/package/@interopio/workspaces-api) library and start the Workspace trace in the calling app.

#### interopio.api.workspaces.createWorkspace

Traces creating a Workspace via the `io.workspaces.createWorkspace()` method.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `reuseFrameId` | `string` | - | ID of the Workspaces App instance to reuse. Can be used in the span filtering context. |

#### interopio.api.workspaces.restoreWorkspace

Traces restoring a Workspace Layout via the `io.workspaces.restoreWorkspace()` method.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `layoutName` | `string` | - | Name of the Workspace Layout. Can be used in the span filtering context. |
| `restoreFrameId` | `string` | - | ID of the Workspaces App instance in which to restore the Workspace. Can be used in the span filtering context. |
| `restoreLoadingStrategy` | `string` | - | Loading strategy requested for the restored Workspace. Can be used in the span filtering context. |

## @interopio/workspaces-ui-react

The [Workspaces App](https://docs.interop.io/browser/capabilities/windows/workspaces/workspaces-app/index.md) built with the [`@interopio/workspaces-ui-react`](https://www.npmjs.com/package/@interopio/workspaces-ui-react) library publishes traces related to creating Workspaces and starting the apps in them. All spans related to the Workspaces App are prefixed with `"interopio.workspaces.frame"`. These spans are part of the Workspace trace.

The Workspaces App is a Browser Client, so its spans have the [common span attributes](#interopiobrowser-common_span_attributes) of the `@interopio/browser` library.

### interopio.workspaces.frame

Traces related to Workspace operations in the Workspaces App.

#### interopio.workspaces.frame.app.start

Traces starting an app in a Workspace.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `appName` | `string` | - | Name of the app. Can be used in the span filtering context. |
| `workspaceId` | `string` | - | ID of the Workspace. Can be used in the span filtering context. |

#### interopio.workspaces.frame.createWorkspace

Traces creating a Workspace in the Workspaces App.

#### interopio.workspaces.frame.initFrame

Traces initializing the Workspaces App with its Workspace configuration.

#### interopio.workspaces.frame.initFrameFromSnapshot

Traces initializing the Workspaces App from a saved snapshot.

#### interopio.workspaces.frame.openWorkspace

Traces restoring a Workspace Layout in the Workspaces App.

Additional span attributes:

| Field | Type | Level | Description |
|-------|------|-------|-------------|
| `layoutName` | `string` | - | Name of the Workspace Layout. Can be used in the span filtering context. |
| `loadingStrategy` | `string` | - | Loading strategy requested for the Workspace. Can be used in the span filtering context. |

## Custom Traces

The Main app and the Browser Clients can publish custom spans via the Insights API. Their names and attributes are defined by the app and aren't part of the predefined catalog.

> ℹ️ *For examples of creating custom spans, tracing asynchronous operations, and propagating context, see the [Insights API > JavaScript > Traces](https://docs.interop.io/insights/insights-api/javascript/index.md#traces) section.*
