io.Insights

Overview

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

The following sections describe only the configuration settings relevant to io.Connect Browser. For more in-depth information on io.Insights and the data it publishes, see the io.Insights documentation.

Configuration

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"

For more details on all available predefined metrics, see the Default Metrics section in the io.Insights documentation.