WebRTC Metrics

A comprehensive overview of WebRTC statistics, derived calculations, extracted features, and observable signals, to better understand call quality, connectivity, and user experience in rtcStats

Back
connectiongeolocationgeoiprelayturn

Relay geolocation (feature)

Where your TURN relays sat, derived from any locally-gathered relay candidate, so you can catch misplaced relays that add avoidable latency.

Description

Connection-level features, extracted per RTCPeerConnection into features_connection.

When your rtcstats-server is configured for geolocation, these fields annotate any locally-gathered relay (TURN) candidate with geographic data:

  • rtcstatsRelayLocationContinent - continent of the relay.
  • rtcstatsRelayLocationCountry - country of the relay.
  • rtcstatsRelayLocationCity - city of the relay.

These are only populated when a relay candidate was gathered, and are null when GeoIP is not configured or the address cannot be resolved. Location is derived on your own server from the relay candidate address.

Why it matters

A relay sitting far from the users it serves is latency you can design away. If a call between two peers in one region is relayed through a TURN server on another continent, every media packet takes a long detour, and this field is how you catch it. Comparing relay location against peer and local location shows whether your TURN placement matches where traffic actually is: a cluster of calls whose relay country differs from both endpoints is a signal to deploy TURN capacity closer to those users. Because it is derived from the gathered relay candidate, it reflects the relay the client actually reached, not just what you configured.

SQL example

Relay usage by relay country:

SELECT
  connection.rtcstats_relay_location_country AS relay_country,
  COUNT(*) AS connections
FROM features_connection AS connection
WHERE connection.rtcstats_relay_location_country IS NOT NULL
  AND connection.ice_connected -- only connections that found a path
GROUP BY connection.rtcstats_relay_location_country
ORDER BY connections DESC;

See also