Skip to main content

Calls Metrics and Monitoring

This guide provides detailed information on monitoring Mattermost Calls performance and health through metrics and observability tools. Effective monitoring is essential for maintaining optimal call quality and quickly addressing any issues that arise.

Metrics Overview

Mattermost Calls provides metrics through Prometheus for both the Calls plugin and the RTCD service. These metrics help track:

  • Active call sessions and participants
  • Media track statistics
  • Connection states and errors
  • Resource utilization (CPU, memory, network)
  • WebSocket connections and events

The metrics are exposed through HTTP endpoints:

  • Calls Plugin: /plugins/com.mattermost.calls/metrics
  • RTCD Service: /metrics (default) or a configured endpoint

Resource utilization metrics (CPU, memory, network) are mainly provided by an external service (node-exporter).

Metrics for the calls plugin are exposed through the /plugins/com.mattermost.calls/metrics subpath under the existing Mattermost server metrics endpoint. This is controlled by the Listen address for performance configuration setting. It defaults to port 8067. For example: http://localhost:8067/plugins/com.mattermost.calls/metrics The RTCD Service /metrics endpoint is exposed on the HTTP API (e.g. http://localhost:8045/metrics).

Setting Up Monitoring

For instructions on deploying Prometheus and Grafana for Mattermost, please refer to the Deploy Prometheus and Grafana for performance monitoring guide.

Once Prometheus and Grafana are set up, you will need to configure Prometheus to scrape metrics from the Calls-related services.

Prometheus Scrape Configuration

Add the following jobs to your prometheus.yml configuration:

scrape_configs:
- job_name: 'calls-plugin'
metrics_path: /plugins/com.mattermost.calls/metrics
static_configs:
- targets: ['MATTERMOST_SERVER_IP:8067']
labels:
service_name: 'calls-plugin'

- job_name: 'rtcd'
metrics_path: /metrics
static_configs:
- targets: ['RTCD_SERVER_IP:8045']
labels:
service_name: 'rtcd'

- job_name: 'rtcd-node-exporter'
metrics_path: /metrics
static_configs:
- targets: ['RTCD_SERVER_IP:9100']
labels:
service_name: 'rtcd'

- job_name: 'calls-offloader-node-exporter'
metrics_path: /metrics
static_configs:
- targets: ['CALLS_OFFLOADER_SERVER_IP:9100']
labels:
service_name: 'offloader'

Replace the placeholder IP addresses with your actual server addresses:

  • MATTERMOST_SERVER_IP: IP address of your Mattermost server
  • RTCD_SERVER_IP: IP address of your RTCD server
  • CALLS_OFFLOADER_SERVER_IP: IP address of your calls-offloader server (if deployed)

Mattermost Calls Grafana Dashboard

You can use the official Mattermost Calls Performance Monitoring dashboard to visualize these metrics.

Key Metrics to Monitor

RTCD Metrics

Process Metrics

These metrics help monitor the health and resource usage of the RTCD process:

  • rtcd_process_cpu_seconds_total: Total CPU time spent
  • rtcd_process_open_fds: Number of open file descriptors
  • rtcd_process_max_fds: Maximum number of file descriptors
  • rtcd_process_resident_memory_bytes: Memory usage in bytes
  • rtcd_process_virtual_memory_bytes: Virtual memory used

WebRTC Connection Metrics

These metrics track the WebRTC connections and media flow:

  • rtcd_rtc_conn_states_total{state="X"}: Count of connections in different states
  • rtcd_rtc_errors_total{type="X"}: Count of RTC errors by type
  • rtcd_rtc_rtp_tracks_total{direction="X"}: Count of RTP tracks (incoming/outgoing)
  • rtcd_rtc_sessions_total: Total number of active RTC sessions

WebSocket Metrics

These metrics track the signaling channel:

  • rtcd_ws_connections_total: Total number of active WebSocket connections. This is about RTCD <-> MM, so the connection count should match the number of MM nodes.
  • rtcd_ws_messages_total{direction="X"}: Count of WebSocket messages (sent/received)

Calls Plugin Metrics

Similar metrics are available for the Calls plugin with the following prefixes:

  • Process metrics: mattermost_plugin_calls_process_*
  • WebRTC connection metrics: mattermost_plugin_calls_rtc_*
  • WebSocket metrics: mattermost_plugin_calls_websocket_*
  • Store metrics: mattermost_plugin_calls_store_ops_total

Performance Baselines

The following performance benchmarks provide baseline metrics for RTCD deployments under various load conditions and configurations.

Deployment specifications

  • 1x r6i.large nginx proxy
  • 3x c5.large MM app nodes (HA)
  • 2x db.x2g.xlarge RDS Aurora MySQL v8 (one writer, one reader)
  • 1x (c7i.xlarge, c7i.2xlarge, c7i.4xlarge) RTCD
  • 2x c7i.2xlarge load-test agents

App specifications

  • Mattermost v9.6
  • Mattermost Calls v0.28.0
  • RTCD v0.16.0
  • load-test agent v0.28.0

Media specifications

  • Speech sample bitrate: 80Kbps
  • Screen sharing sample bitrate: 1.6Mbps

Results

Below are the detailed benchmarks based on internal performance testing:

CallsParticipants/callUnmuted/callScreen sharingCPU (avg)Memory (avg)Bandwidth (in/out)Instance type (RTCD)
110002no47%1.46GB1Mbps / 194Mbpsc7i.xlarge
18001yes64%1.43GB2.7Mbps / 1.36Gbpsc7i.xlarge
110001yes79%1.54GB2.9Mbps / 1.68Gbpsc7i.xlarge
101001yes74%1.56GB18.2Mbps / 1.68Gbpsc7i.xlarge
100102no49%1.46GB18.7Mbps / 175Mbpsc7i.xlarge
100101yes84%1.73GB171Mbps / 1.53Gbpsc7i.xlarge
110002no20%1.44GB1.4Mbps / 194Mbpsc7i.2xlarge
110002yes49%1.53GB3.6Mbps / 1.79Gbpsc7i.2xlarge
210001yes73%2.38GB5.7Mbps / 3.06Gbpsc7i.2xlarge
100102yes60%1.74GB181Mbps / 1.62Gbpsc7i.2xlarge
150101yes72%2.26GB257Mbps / 2.30Gbpsc7i.2xlarge
150102yes79%2.34GB271Mbps / 2.41Gbpsc7i.2xlarge
250102no58%2.66GB47Mbps / 439Mbpsc7i.2xlarge
100022no78%2.31GB178Mbps / 195Mbpsc7i.2xlarge
210002yes41%2.6GB7.23Mbps / 3.60Gbpsc7i.4xlarge
310002yes63%3.53GB10.9Mbps / 5.38Gbpsc7i.4xlarge
410002yes83%4.40GB14.5Mbps / 7.17Gbpsc7i.4xlarge
250102yes79%3.49GB431Mbps / 3.73Gbpsc7i.4xlarge
50022yes71%2.54GB896Mbps / 919Mbpsc7i.4xlarge

Troubleshooting Metrics Collection

Verify RTCD Metrics are Being Collected

To verify that Prometheus is successfully collecting RTCD metrics, use this command:

curl http://PROMETHEUS_IP:9090/api/v1/label/__name__/values | jq '.' | grep rtcd

This command queries Prometheus for all available metric names and filters for RTCD-related metrics.

If no RTCD metrics appear, check:

  1. RTCD is running
  2. Prometheus is configured to scrape the RTCD metrics endpoint
  3. RTCD metrics port is accessible from Prometheus (default: 8045)

Check Prometheus Scrape Targets

To verify all Calls-related services are being scraped successfully:

  1. Open the Prometheus web interface (typically http://PROMETHEUS_IP:9090)
  2. Navigate to Status > Targets
  3. Look for your configured Calls services:
    • Mattermost server (for Calls plugin metrics)
    • RTCD service

Each target should show status "UP" in green. If a target shows "DOWN" or errors:

  • Verify the service is running
  • Check network connectivity between Prometheus and the target
  • Verify the metrics endpoint is accessible

Other Calls Documentation

Note: Configure Prometheus storage accordingly to balance disk usage with retention needs. If you need to be tight on storage, you can use a short retention period. If you have lots of storage you can keep the retention length longer.