# Overview

Source: https://docs.interop.io/insights/signals/traces/overview/index.html

## Overview

**io.Insights** publishes a wide array of default traces that provide information about the platform processes and the usage of the io.Connect libraries. Depending on the configuration, the provided instrumentation can also trace app startup, user interactions, network activity, app performance, and errors.

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

> ℹ️ *For the default traces published by each platform and its libraries, see the [Traces > io.Connect Desktop](https://docs.interop.io/insights/signals/traces/io-connect-desktop/index.md) and the [Traces > io.Connect Browser](https://docs.interop.io/insights/signals/traces/io-connect-browser/index.md) sections respectively.*

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

> ℹ️ *For details on the tracing concepts used by **io.Insights** (active span, propagation, filtering, sampling, verbosity levels), see the [Concepts & Considerations > Traces](https://docs.interop.io/insights/concepts-considerations/index.md#traces) section.*

## Trace Payload Structure

Traces are published as standard OpenTelemetry trace payloads.

> ℹ️ *For more details on the standard structure of OpenTelemetry signals, see the [OpenTelemetry examples](https://github.com/open-telemetry/opentelemetry-proto/tree/main/examples) in GitHub.*

The following example demonstrates the basic structure of a trace payload:

```json
{
    "resourceSpans": [
        {
            "resource": {
                "attributes": [
                    // Attributes describing the resource publishing the traces -
                    // e.g., `"service.name"`, `"service.instance.id"`, and other standard OpenTelemetry attributes.
                ]
            },
            "scopeSpans": [
                {
                    "scope": {
                        "name": "interopio.desktop.startup",
                        "version": ""
                    },
                    "spans": [
                        // List of span objects describing the published spans.
                    ]
                }
            ]
        }
    ]
}
```

The following is an example of a trace payload containing spans from the `"interopio.desktop.startup"` trace published by **io.Connect Desktop**. The root span `"interopio.desktop.startup"` has two child spans (`"interopio.desktop.startup.startup"` and `"interopio.desktop.startup.init"`) - linked to it via the `"parentSpanId"` field:

```json
{
    "resourceSpans": [
        {
            "resource": {
                "attributes": [
                    { "key": "service.name", "value": { "stringValue": "io.Connect Desktop" } },
                    { "key": "service.instance.id", "value": { "stringValue": "hSzwWyE3TkdE5r-ZqmTq" } },
                    { "key": "service.version", "value": { "stringValue": "10.1.0" } },
                    { "key": "user", "value": { "stringValue": "user_42" } },
                    { "key": "user.id", "value": { "stringValue": "user_42" } },
                    { "key": "platformVersion", "value": { "stringValue": "10.1.0" } },
                    { "key": "machine", "value": { "stringValue": "PW052B0C" } },
                    { "key": "host", "value": { "stringValue": "iocd" } },
                    { "key": "osUser", "value": { "stringValue": "user_42" } },
                    { "key": "region", "value": { "stringValue": "DEMO" } },
                    { "key": "env", "value": { "stringValue": "DEMO" } },
                    { "key": "advancedMode", "value": { "boolValue": true } },
                    { "key": "tracingAppName", "value": { "stringValue": "io.Connect Desktop" } },
                    { "key": "tracingAppInstance", "value": { "stringValue": "hSzwWyE3TkdE5r-ZqmTq" } }
                ],
                "droppedAttributesCount": 0
            },
            // The root span.
            "scopeSpans": [
                {
                    "scope": {
                        "name": "interopio.desktop.startup",
                        "version": ""
                    },
                    "spans": [
                        {
                            "traceId": "db787c70760f29b163566c96b9863198",
                            "spanId": "1a95dcb7bdaeb0ff",
                            "parentSpanId": "",
                            "name": "interopio.desktop.startup",
                            "kind": 1,
                            "startTimeUnixNano": 1774876487256000000,
                            "endTimeUnixNano": 1774876519690000000,
                            "attributes": [
                                { "key": "platformVersion", "value": { "stringValue": "10.1.0" } },
                                { "key": "sid", "value": { "stringValue": "user_42" } }
                            ],
                            "droppedAttributesCount": 0,
                            "droppedEventsCount": 0,
                            "droppedLinksCount": 0,
                            "status": { "code": 0, "message": "" }
                        }
                    ]
                }
            ]
        },
        {
            "resource": {
                // Same resource attributes as above.
            },
            // Child spans share the same `traceId` and reference the root span via `parentSpanId`.
            "scopeSpans": [
                {
                    "scope": {
                        "name": "interopio.desktop.startup.startup",
                        "version": ""
                    },
                    "spans": [
                        {
                            "traceId": "db787c70760f29b163566c96b9863198",
                            "spanId": "92f6f18630754d8e",
                            "parentSpanId": "1a95dcb7bdaeb0ff",
                            "name": "interopio.desktop.startup.startup",
                            "kind": 1,
                            "startTimeUnixNano": 1774876487256000000,
                            "endTimeUnixNano": 1774876487998000000,
                            "attributes": [
                                { "key": "platformVersion", "value": { "stringValue": "10.1.0" } },
                                { "key": "sid", "value": { "stringValue": "user_42" } }
                            ],
                            "droppedAttributesCount": 0,
                            "droppedEventsCount": 0,
                            "droppedLinksCount": 0,
                            "status": { "code": 0, "message": "" }
                        },
                        {
                            "traceId": "db787c70760f29b163566c96b9863198",
                            "spanId": "59be404068f0a82b",
                            "parentSpanId": "1a95dcb7bdaeb0ff",
                            "name": "interopio.desktop.startup.init",
                            "kind": 1,
                            "startTimeUnixNano": 1774876488135000000,
                            "endTimeUnixNano": 1774876488298000000,
                            "attributes": [
                                { "key": "platformVersion", "value": { "stringValue": "10.1.0" } },
                                { "key": "sid", "value": { "stringValue": "user_42" } }
                            ],
                            "droppedAttributesCount": 0,
                            "droppedEventsCount": 0,
                            "droppedLinksCount": 0,
                            "status": { "code": 0, "message": "" }
                        }
                    ]
                }
            ]
        }
    ]
}
```

## Span Sources

Each span is created for a specific source - a string identifying the instrumented operation (e.g., `"interopio.api.interop.invoke"`). The source is used for matching the span against the [span filters](https://docs.interop.io/insights/concepts-considerations/index.md#traces-filtering) and is also the name of the exported span, except where the respective span description states otherwise (e.g., the spans for HTTP requests are named by the HTTP request method by default).

Sources are hierarchical - the spans are grouped in families by their common prefix (e.g., `"interopio.api.interop"`), and a span filter for a family applies to all of its members. The trace catalogs for each platform are organized in the same way: each family is described in a separate section, and each span in a sub-section of its family.

## Span Attributes

Each span has common span attributes specific to the entity that published it (e.g., the platform or an io.Connect library). They are described in the respective section of the trace catalog for each platform.

Each span may also have additional span attributes described in its sub-section in the trace catalog. If a span sub-section contains only the span description, the span doesn't have any span-specific attributes.

The tables describing the span-specific attributes have the following columns:

| Column | Description |
|--------|-------------|
| Field | Name of the span attribute. |
| Type | Type of the attribute value. |
| Level | Minimum [verbosity level](https://docs.interop.io/insights/concepts-considerations/index.md#traces-verbosity_levels) of the span at which the attribute is published. A `-` value means that the attribute is part of the span filtering context and isn't controlled by the verbosity level - it's published unless the `addContextToTrace` property of the matching span filter is set to `false`. |
| Description | Description of the attribute. If the attribute can be used in the span filtering context, this is explicitly stated in its description. |

All additional span attributes provided via the platform configuration or dynamically via the Insights API will also be included in the respective spans. If the resource-level attributes are configured to be merged with the data point attributes, all resource-level attributes will also be included in every span.

> ⚠️ *Note that the attributes published at the `"DIAGNOSTIC"` verbosity level may contain personally identifiable information (PII) or other sensitive data, such as method arguments and context data. Use this level cautiously and only for a limited set of spans, users, or environments.*

> ℹ️ *For details on the resource-level attributes common to all signals (metrics, traces, logs), see the [Signals > Overview > Common Resource Attributes](https://docs.interop.io/insights/signals/overview/index.md#common_resource_attributes) section.*
