Viewing Remote Session Metrics
Understanding the performance of remote access sessions helps you identify issues and improve the reliability and performance of remote access connections. You can view metrics for remote sessions using OpenTelemetry in the ThingWorx Platform.
Viewing Remote Session Metrics Using OpenTelemetry
Starting from RAE 3.5.1, the ThingWorx Platform (version 9.7.0 and later) supports reporting remote session metrics using the OpenTelemetry SDK, enabling you to track the number of successful and failed sessions. This replaces the previous metrics collection data table. OpenTelemetry is an open-source framework that enables you to generate, collect, process, and export telemetry data such as traces, metrics, and logs. It collects data and lets you choose observability tools for your ThingWorx metrics based on your requirements. OpenTelemetry is compatible with multiple tools, including Prometheus and Splunk, but does not store or display data directly. By default, remote session metrics are not saved permanently. To retain metrics across server restarts, you must configure a storage provider, such as Prometheus, to collect and store data from the Collector. For more information about OpenTelemetry configuration on the ThingWorx Platform, refer to OpenTelemetry for ThingWorx Platform Logging in the ThingWorx Platform Help Center. The following is a list of metrics that are logged using OpenTelemetry:
instance—The ThingWorx platform instance and the port number where the metric is reported.
isSuccessful—Whether the remote session is successful.
* 
Using OpenTelemetry does not guarantee capturing all remote session metrics. A small number of metrics may be missed because of OpenTelemetry limitations. This is expected and is not planned to be fixed.
The legacy method of using a data table is deprecated but still available. To continue using it, you must enable it in the configuration of the Remote Access Subsystem. For more information on enabling the data table, refer to the following section.
Deprecated—Using a Data Table to Collect Metrics
* 
The data table implementation of session metrics is deprecated in RAE 3.5.1 and will be removed in a future release. Avoid using any associated services or entities in custom implementations that rely on these metrics.
To enable logging of remote session metrics to the deprecated data table in 3.5.1 or later, perform the following steps:
1. In ThingWorx Composer, click Browse > Subsystems.
2. Select the RemoteAccessSubsystem, then open the Configuration tab.
3. Enable the Use DataTable for Metrics check box, then click Save.
To retrieve the session metrics manually, perform the following steps:
1. In ThingWorx Composer, click Browse > Subsystems.
2. Select the RemoteAccessSubsystem, then open the Services tab.
3. Execute one of the following services, depending on the metric that you want to view.
a. GetTotalSessionsCount—Returns the number of total sessions on the server.
b. GetSuccessfulSessionsCount—Returns the number of successful sessions on the server. This includes sessions that are terminated by the user or the agent or time out because of inactivity.
c. GetFailedSessionsCount—Returns the number of failed sessions on the server. This includes sessions that end unexpectedly because of errors or are never started because of connection issues or access restrictions.
Session metrics are stored in the RemoteSessionsMetrics Data Table. ThingWorx data tables can store up to 100000 rows of data, which limits the number of metrics that you can store at a time. For more information, see Sizing Limits of Data Tables in the ThingWorx Platform help center. By default, RAE is configured to keep session metrics for 30 days. To specify how long to keep the session metrics, perform the following steps:
1. In ThingWorx Composer, click Browse > Subsystems.
2. Select the RemoteAccessSubsystem, then open the Configuration tab.
3. Under the Time to keep metrics data in Days option, specify a value between 30 and 365.
4. Click Save.
The changes are applied to the subsystem. Any metrics that are older than the specified number of days is automatically deleted when the PurgeRemoteSessionsMetricsScheduler runs. For more information, see PurgeRemoteSessionsMetricsScheduler Schedule Thing.
Was this helpful?