Configuration

Overview

io.Insights comes as a built-in feature of both io.Connect Desktop and io.Connect Browser. The default data points it publishes can be enabled, disabled or customized based on your specific business scenarios.

io.Connect Desktop

io.Insights is disabled by default. To enable io.Insights and configure its features in io.Connect Desktop, use the "otel" top-level key in the system.json system configuration file of io.Connect Desktop located in the %LocalAppData%/interop.io/io.Connect Desktop/Desktop/config folder:

{
    "otel": {
        "enabled": true,
        "metrics": {
            "enabled": true,
            "url": "http://localhost:4242/my-metrics-collector",
            "publishInterval": 60000,
            "defaultMetricsEnabled": true,
            "metrics": [
                {
                   "type": "app_crash",
                   "enabled": false
                }
            ]
        }
    }
}

The "otel" object has the following properties:

Property Type Description
"enabled" boolean Required. If true, will enable publishing of telemetry data. Defaults to false.
"metrics" object Settings for publishing metrics.

Metrics

To provide custom settings for publishing metrics, use the "metrics" property of the "otel" object.

The "metrics" object has the following properties:

Property Type Description
"defaultMetricsEnabled" boolean If true (default), will enable publishing of all default metrics.
"enabled" boolean If true (default), will enable publishing metrics.
"metrics" object[] Settings for the default metrics. Defaults to [].
"publishInterval" number Interval in milliseconds at which to publish the generated metrics. Defaults to 30000.
"url" string URL pointing to an OpenTelemetry metrics collector.

You can enable, disable or override the settings for the default metrics published by io.Insights by using a combination of the "defaultMetricsEnabled" and the "metrics" properties of the "metrics" object. For instance, you can enable all default metrics by setting the "defaultMetricsEnabled" to true, and then disable or customize individual metrics by specifying the predefined metric type in the "metrics" array:

{
    "otel": {
        "enabled": true,
        "metrics": {
            "url": "http://localhost:4242/my-metrics-collector",
            "defaultMetricsEnabled": true,
            "metrics": [
                // Disabling a default metric.
                {
                   "type": "app_error",
                   "enabled": false
                },
                // Overriding the default settings for a predefined metric.
                {
                    "type": "layout_startup",
                    "name": "Global Layout Startup",
                    "description": "The time it takes to load a Global Layout.",
                    "buckets": [
                        10000,
                        15000,
                        20000,
                    ]
                }
            ]
        }
    }
}

Each object in the "metrics" array has the following properties:

Property Type Description
"buckets" number[] Specify explicit bucket boundaries for the OpenTelemetry SDK if the metric is a Histogram.
"description" string Description for the metric.
"enabled" boolean If true (default), will enable publishing the metric.
"name" string Name for the metric. May be used in visualization tools.
"type" string Required. Type of the predefined metric.

The "type" property accepts the following values describing a predefined metric type:

Value
"app_count"
"app_cpu"
"app_crash"
"app_duration"
"app_error"
"app_memory"
"app_started"
"app_startup"
"app_stopped"
"layout_startup"
"platform_error"
"platform_startup"
"system_cpu"
"system_memory"
"workspace_count"
"workspace_startup"
"workspace_stopped"

io.Connect Browser

io.Insights is disabled by default. To enable io.Insights and configure its features in io.Connect Browser, use the otel property of the configuration object when initializing your Main app:

import IOBrowserPlatform from "@interopio/browser-platform";

const config = {
    licenseKey: "my-license-key",
    // Enabling io.Insights and providing settings for publishing data.
    otel: {
        metrics: {
            url: "http://localhost:4242/my-metrics-collector",
            metrics: [
                {
                    type: "app_error",
                    enabled: false
                }
            ]
        }
    }
};

const { io } = await IOBrowserPlatform(config);

The otel object has the following properties:

Property Type Description
metrics object Settings for publishing metrics.

Metrics

To provide custom settings for publishing metrics, use the metrics property of the otel object.

The metrics object has the following properties:

Property Type Description
metrics object[] Settings for the default metrics. Defaults to [].
publishInterval number Interval in milliseconds at which to publish the generated metrics. Defaults to 30000.
url string Required. URL pointing to an OpenTelemetry metrics collector. Providing a URL enables io.Insights and publishing of the default metrics.

You can enable, disable or override the settings for the default metrics published by io.Insights by using the metrics property of the metrics object.

The following example demonstrates how to disable and customize individual metrics by specifying the predefined metric type in the metrics array:

import IOBrowserPlatform from "@interopio/browser-platform";

const config = {
    licenseKey: "my-license-key",
    otel: {
        metrics: {
            url: "http://localhost:4242/my-metrics-collector",
            metrics: [
                // Disabling a default metric.
                {
                   type: "app_error",
                   enabled: false
                },
                // Overriding the default settings for a predefined metric.
                {
                    type: "layout_startup",
                    name: "Global Layout Startup",
                    description: "The time it takes to load a Global Layout.",
                    buckets: [
                        10000,
                        15000,
                        20000,
                    ]
                }
            ]
        }
    }
};

const { io } = await IOBrowserPlatform(config);

Each object in the metrics array has the following properties:

Property Type Description
buckets number[] Specify explicit bucket boundaries for the OpenTelemetry SDK if the metric is a Histogram.
description string Description for the metric.
enabled boolean If true (default), will enable publishing the metric.
name string Name for the metric. May be used in visualization tools.
type string Required. Type of the predefined metric.

The type property accepts the following values describing a predefined metric type:

Value
"app_count"
"app_duration"
"app_error"
"app_started"
"app_startup"
"app_stopped"
"layout_startup"
"platform_error"
"platform_startup"
"workspace_count"
"workspace_startup"
"workspace_stopped"