ClientSample

ClientSample

The ClientSample is the primary schema for WebRTC monitoring data collected from clients. It contains comprehensive statistics and metadata about WebRTC sessions, extending the WebRTC W3C Stats API standard with additional context for observability and analytics.

Schema Version: 3.0.0

Core Structure

The ClientSample follows a hierarchical structure with PeerConnectionSample containing nested arrays of different statistics types:

ClientSample
├── Basic Metadata (timestamp, callId, clientId, attachments, score)
├── peerConnections[] (PeerConnectionSample)
│   ├── inboundTracks[]
│   ├── outboundTracks[]
│   ├── codecs[]
│   ├── inboundRtps[]
│   ├── remoteInboundRtps[]
│   ├── outboundRtps[]
│   ├── remoteOutboundRtps[]
│   ├── mediaSources[]
│   ├── mediaPlayouts[]
│   ├── peerConnectionTransports[]
│   ├── dataChannels[]
│   ├── iceTransports[]
│   ├── iceCandidates[]
│   ├── iceCandidatePairs[]
│   └── certificates[]
├── clientEvents[]
├── clientIssues[]
├── clientMetaItems[]
└── extensionStats[]

ClientSample

FieldTypeDescription
timestampnumberThe timestamp the sample is created in GMT
callIdstring (optional)The unique identifier of the call or session
clientIdstring (optional)Unique id of the client providing samples
attachmentsRecord<string, unknown> (optional)Additional information attached to this sample (e.g.: roomId, userId, displayName, etc…)
scorenumber (optional)Calculated score for client (details should be added to attachments)
peerConnectionsPeerConnectionSample[] (optional)Samples taken from PeerConnections
clientEventsClientEvent[] (optional)A list of client events
clientIssuesClientIssue[] (optional)A list of client issues
clientMetaItemsClientMetaData[] (optional)A list of additional client events
extensionStatsExtensionStat[] (optional)The WebRTC app provided custom stats payload

PeerConnectionSample

Represents a WebRTC peer connection and contains all its associated statistics.

FieldTypeDescription
peerConnectionIdstringUnique identifier of the stats object
attachmentsRecord<string, unknown> (optional)Additional information attached to this sample
scorenumber (optional)Calculated score for peer connection (details should be added to attachments)
inboundTracksInboundTrackSample[] (optional)Inbound Track Stats items
outboundTracksOutboundTrackSample[] (optional)Outbound Track Stats items
codecsCodecStats[] (optional)Codec items
inboundRtpsInboundRtpStats[] (optional)Inbound RTPs
remoteInboundRtpsRemoteInboundRtpStats[] (optional)Remote Inbound RTPs
outboundRtpsOutboundRtpStats[] (optional)Outbound RTPs
remoteOutboundRtpsRemoteOutboundRtpStats[] (optional)Remote Outbound RTPs
mediaSourcesMediaSourceStats[] (optional)Audio Source Stats
mediaPlayoutsMediaPlayoutStats[] (optional)Media Playout Stats
peerConnectionTransportsPeerConnectionTransportStats[] (optional)PeerConnection Transport Stats
dataChannelsDataChannelStats[] (optional)Data Channels Stats
iceTransportsIceTransportStats[] (optional)ICE Transport Stats
iceCandidatesIceCandidateStats[] (optional)ICE Candidate Stats
iceCandidatePairsIceCandidatePairStats[] (optional)ICE Candidate Pair Stats
certificatesCertificateStats[] (optional)Certificates

InboundRtpStats

Statistics for incoming RTP streams.

FieldTypeDescription
timestampnumberThe time the stats were collected, in high-resolution time
idstringUnique identifier of the stats object
ssrcnumberSynchronization source identifier of the RTP stream
kindstringKind of the media (e.g., ‘audio’ or ‘video’)
trackIdentifierstringIdentifier for the media track associated with the RTP stream
transportIdstring (optional)ID of the transport associated with the RTP stream
codecIdstring (optional)ID of the codec used for the RTP stream
packetsReceivednumber (optional)Number of packets received on the RTP stream
packetsLostnumber (optional)Number of packets lost on the RTP stream
jitternumber (optional)Jitter of the RTP stream in seconds
midstring (optional)The MediaStream ID of the RTP stream
remoteIdstring (optional)Remote stats object ID associated with the RTP stream
framesDecodednumber (optional)Number of frames decoded
keyFramesDecodednumber (optional)Number of keyframes decoded
framesRenderednumber (optional)Number of frames rendered
framesDroppednumber (optional)Number of frames dropped
frameWidthnumber (optional)Width of the decoded video frames
frameHeightnumber (optional)Height of the decoded video frames
framesPerSecondnumber (optional)Frame rate in frames per second
qpSumnumber (optional)Sum of the Quantization Parameter values for decoded frames
totalDecodeTimenumber (optional)Total time spent decoding in seconds
totalInterFrameDelaynumber (optional)Sum of inter-frame delays in seconds
totalSquaredInterFrameDelaynumber (optional)Sum of squared inter-frame delays in seconds
pauseCountnumber (optional)Number of times playback was paused
totalPausesDurationnumber (optional)Total duration of pauses in seconds
freezeCountnumber (optional)Number of times playback was frozen
totalFreezesDurationnumber (optional)Total duration of freezes in seconds
lastPacketReceivedTimestampnumber (optional)Timestamp of the last packet received
headerBytesReceivednumber (optional)Total header bytes received
packetsDiscardednumber (optional)Total packets discarded
fecBytesReceivednumber (optional)Total bytes received from FEC
fecPacketsReceivednumber (optional)Total packets received from FEC
fecPacketsDiscardednumber (optional)Total FEC packets discarded
bytesReceivednumber (optional)Total bytes received on the RTP stream
nackCountnumber (optional)Number of NACKs sent
firCountnumber (optional)Number of Full Intra Requests sent
pliCountnumber (optional)Number of Picture Loss Indications sent
totalProcessingDelaynumber (optional)Total processing delay in seconds
estimatedPlayoutTimestampnumber (optional)Estimated timestamp of playout
jitterBufferDelaynumber (optional)Total jitter buffer delay in seconds
jitterBufferTargetDelaynumber (optional)Target delay for the jitter buffer in seconds
jitterBufferEmittedCountnumber (optional)Number of packets emitted from the jitter buffer
jitterBufferMinimumDelaynumber (optional)Minimum delay of the jitter buffer in seconds
totalSamplesReceivednumber (optional)Total audio samples received
concealedSamplesnumber (optional)Number of concealed audio samples
silentConcealedSamplesnumber (optional)Number of silent audio samples concealed
concealmentEventsnumber (optional)Number of audio concealment events
insertedSamplesForDecelerationnumber (optional)Number of audio samples inserted for deceleration
removedSamplesForAccelerationnumber (optional)Number of audio samples removed for acceleration
audioLevelnumber (optional)Audio level in the range [0.0, 1.0]
totalAudioEnergynumber (optional)Total audio energy in the stream
totalSamplesDurationnumber (optional)Total duration of all received audio samples in seconds
framesReceivednumber (optional)Total number of frames received
decoderImplementationstring (optional)Decoder implementation used for decoding frames
playoutIdstring (optional)Playout identifier for the RTP stream
powerEfficientDecoderboolean (optional)Indicates if the decoder is power-efficient
attachmentsRecord<string, unknown> (optional)Additional information attached to this stats

OutboundRtpStats

Statistics for outgoing RTP streams.

FieldTypeDescription
timestampnumberThe timestamp for this stats object in DOMHighResTimeStamp format
idstringThe unique identifier for this stats object
ssrcnumberThe SSRC identifier of the RTP stream
kindstringThe type of media (‘audio’ or ‘video’)
transportIdstring (optional)The ID of the transport used for this stream
codecIdstring (optional)The ID of the codec used for this stream
packetsSentnumber (optional)The total number of packets sent on this stream
bytesSentnumber (optional)The total number of bytes sent on this stream
midstring (optional)The media ID associated with this RTP stream
mediaSourceIdstring (optional)The ID of the media source associated with this stream
remoteIdstring (optional)The ID of the remote object corresponding to this stream
ridstring (optional)The RID value of the RTP stream
headerBytesSentnumber (optional)The total number of header bytes sent on this stream
retransmittedPacketsSentnumber (optional)The number of retransmitted packets sent on this stream
retransmittedBytesSentnumber (optional)The number of retransmitted bytes sent on this stream
rtxSsrcnumber (optional)The SSRC for the RTX stream, if applicable
targetBitratenumber (optional)The target bitrate for this RTP stream in bits per second
totalEncodedBytesTargetnumber (optional)The total target encoded bytes for this stream
frameWidthnumber (optional)The width of the frames sent in pixels
frameHeightnumber (optional)The height of the frames sent in pixels
framesPerSecondnumber (optional)The number of frames sent per second
framesSentnumber (optional)The total number of frames sent on this stream
hugeFramesSentnumber (optional)The total number of huge frames sent on this stream
framesEncodednumber (optional)The total number of frames encoded on this stream
keyFramesEncodednumber (optional)The total number of key frames encoded on this stream
qpSumnumber (optional)The sum of QP values for all frames encoded on this stream
totalEncodeTimenumber (optional)The total time spent encoding frames on this stream in seconds
totalPacketSendDelaynumber (optional)The total delay for packets sent on this stream in seconds
qualityLimitationReasonstring (optional)The reason for any quality limitation on this stream
qualityLimitationResolutionChangesnumber (optional)The number of resolution changes due to quality limitations
nackCountnumber (optional)The total number of NACK packets sent on this stream
firCountnumber (optional)The total number of FIR packets sent on this stream
pliCountnumber (optional)The total number of PLI packets sent on this stream
encoderImplementationstring (optional)The implementation of the encoder used for this stream
powerEfficientEncoderboolean (optional)Indicates whether the encoder is power efficient
activeboolean (optional)Indicates whether this stream is actively sending data
scalabilityModestring (optional)The scalability mode of the encoder used for this stream
qualityLimitationDurationsQualityLimitationDurations (optional)The duration of quality limitation reasons categorized by type
attachmentsRecord<string, unknown> (optional)Additional information attached to this stats

IceCandidatePairStats

Statistics for ICE candidate pairs.

FieldTypeDescription
idstringThe unique identifier for this RTCStats object
timestampnumberThe timestamp of when the stats were recorded, in seconds
transportIdstring (optional)The transport id of the connection this candidate pair belongs to
localCandidateIdstring (optional)The ID of the local ICE candidate in this pair
remoteCandidateIdstring (optional)The ID of the remote ICE candidate in this pair
statestring (optional)ICE candidate pair state
nominatedboolean (optional)Whether this candidate pair has been nominated
packetsSentnumber (optional)The number of packets sent using this candidate pair
packetsReceivednumber (optional)The number of packets received using this candidate pair
bytesSentnumber (optional)The total number of bytes sent using this candidate pair
bytesReceivednumber (optional)The total number of bytes received using this candidate pair
lastPacketSentTimestampnumber (optional)The timestamp of the last packet sent using this candidate pair
lastPacketReceivedTimestampnumber (optional)The timestamp of the last packet received using this candidate pair
totalRoundTripTimenumber (optional)The total round trip time (RTT) for this candidate pair in seconds
currentRoundTripTimenumber (optional)The current round trip time (RTT) for this candidate pair in seconds
availableOutgoingBitratenumber (optional)The available outgoing bitrate (in bits per second) for this candidate pair
availableIncomingBitratenumber (optional)The available incoming bitrate (in bits per second) for this candidate pair
requestsReceivednumber (optional)The number of ICE connection requests received by this candidate pair
requestsSentnumber (optional)The number of ICE connection requests sent by this candidate pair
responsesReceivednumber (optional)The number of ICE connection responses received by this candidate pair
responsesSentnumber (optional)The number of ICE connection responses sent by this candidate pair
consentRequestsSentnumber (optional)The number of ICE connection consent requests sent by this candidate pair
packetsDiscardedOnSendnumber (optional)The number of packets discarded while attempting to send via this candidate pair
bytesDiscardedOnSendnumber (optional)The total number of bytes discarded while attempting to send via this candidate pair
attachmentsRecord<string, unknown> (optional)Additional information attached to this stats

DataChannelStats

Statistics for WebRTC data channels.

FieldTypeDescription
timestampnumberThe timestamp of the stat
idstringA unique identifier for the stat
labelstring (optional)The label of the data channel
protocolstring (optional)The protocol of the data channel
dataChannelIdentifiernumber (optional)The identifier for the data channel
statestring (optional)The state of the data channel (e.g., ‘open’, ‘closed’)
messagesSentnumber (optional)The number of messages sent on the data channel
bytesSentnumber (optional)The number of bytes sent on the data channel
messagesReceivednumber (optional)The number of messages received on the data channel
bytesReceivednumber (optional)The number of bytes received on the data channel
attachmentsRecord<string, unknown> (optional)Additional information attached to this stats

MediaSourceStats

Statistics for media sources (cameras, microphones, screen capture).

FieldTypeDescription
timestampnumberThe timestamp of the stat
idstringA unique identifier for the stat
kindstringThe type of media (‘audio’ or ‘video’)
trackIdentifierstring (optional)The identifier of the media track
audioLevelnumber (optional)The current audio level
totalAudioEnergynumber (optional)The total audio energy
totalSamplesDurationnumber (optional)The total duration of audio samples
echoReturnLossnumber (optional)The echo return loss
echoReturnLossEnhancementnumber (optional)The enhancement of echo return loss
widthnumber (optional)The width of the video
heightnumber (optional)The height of the video
framesnumber (optional)The total number of frames
framesPerSecondnumber (optional)The frames per second of the video
attachmentsRecord<string, unknown> (optional)Additional information attached to this stats

CodecStats

Information about codecs used in the session.

FieldTypeDescription
timestampnumberThe timestamp when the stats were generated
idstringThe unique identifier for the stats object
mimeTypestringThe MIME type of the codec
payloadTypenumber (optional)The payload type of the codec
transportIdstring (optional)The identifier of the transport associated with the codec
clockRatenumber (optional)The clock rate of the codec in Hz
channelsnumber (optional)The number of audio channels for the codec, if applicable
sdpFmtpLinestring (optional)The SDP format-specific parameters line for the codec
attachmentsRecord<string, unknown> (optional)Additional information attached to this stats

InboundTrackSample

Statistics for inbound media tracks.

FieldTypeDescription
timestampnumberThe timestamp when the stats were generated
idstringThe unique identifier for the stats object
kindstringThe kind of media (‘audio’ or ‘video’)
trackIdentifierstring (optional)The identifier of the media track
remoteSourceboolean (optional)Whether the track is from a remote source
endedboolean (optional)Whether the track has ended
detachedboolean (optional)Whether the track is detached
frameWidthnumber (optional)The width of video frames
frameHeightnumber (optional)The height of video frames
framesPerSecondnumber (optional)The frame rate
framesReceivednumber (optional)The total number of frames received
framesDecodednumber (optional)The total number of frames decoded
framesDroppednumber (optional)The total number of frames dropped
audioLevelnumber (optional)The audio level for audio tracks
totalAudioEnergynumber (optional)The total audio energy
totalSamplesDurationnumber (optional)The total duration of audio samples
attachmentsRecord<string, unknown> (optional)Additional information attached to this stats

OutboundTrackSample

Statistics for outbound media tracks.

FieldTypeDescription
timestampnumberThe timestamp when the stats were generated
idstringThe unique identifier for the stats object
kindstringThe kind of media (‘audio’ or ‘video’)
trackIdentifierstring (optional)The identifier of the media track
remoteSourceboolean (optional)Whether the track is from a remote source
endedboolean (optional)Whether the track has ended
detachedboolean (optional)Whether the track is detached
frameWidthnumber (optional)The width of video frames
frameHeightnumber (optional)The height of video frames
framesPerSecondnumber (optional)The frame rate
framesSentnumber (optional)The total number of frames sent
framesEncodednumber (optional)The total number of frames encoded
audioLevelnumber (optional)The audio level for audio tracks
totalAudioEnergynumber (optional)The total audio energy
totalSamplesDurationnumber (optional)The total duration of audio samples
attachmentsRecord<string, unknown> (optional)Additional information attached to this stats

RemoteInboundRtpStats

Statistics for remote inbound RTP streams (received by the remote peer).

FieldTypeDescription
timestampnumberThe timestamp when the stats were generated
idstringThe unique identifier for the stats object
ssrcnumberThe SSRC identifier of the RTP stream
kindstringThe kind of media (‘audio’ or ‘video’)
transportIdstring (optional)The ID of the transport associated with this stream
codecIdstring (optional)The ID of the codec used for this stream
packetsReceivednumber (optional)The total number of packets received
packetsLostnumber (optional)The total number of packets lost
jitternumber (optional)The jitter in seconds
packetsDiscardednumber (optional)The total number of packets discarded
packetsRepairednumber (optional)The total number of packets repaired
burstPacketsLostnumber (optional)The number of packets lost in bursts
burstPacketsDiscardednumber (optional)The number of packets discarded in bursts
burstLossCountnumber (optional)The number of burst loss events
burstDiscardCountnumber (optional)The number of burst discard events
burstLossRatenumber (optional)The burst loss rate
burstDiscardRatenumber (optional)The burst discard rate
gapLossRatenumber (optional)The gap loss rate
gapDiscardRatenumber (optional)The gap discard rate
framesDroppednumber (optional)The number of frames dropped
partialFramesLostnumber (optional)The number of partial frames lost
fullFramesLostnumber (optional)The number of full frames lost
roundTripTimenumber (optional)The round trip time in seconds
totalRoundTripTimenumber (optional)The total round trip time
roundTripTimeMeasurementsnumber (optional)The number of round trip time measurements
attachmentsRecord<string, unknown> (optional)Additional information attached to this stats

RemoteOutboundRtpStats

Statistics for remote outbound RTP streams (sent by the remote peer).

FieldTypeDescription
timestampnumberThe timestamp when the stats were generated
idstringThe unique identifier for the stats object
ssrcnumberThe SSRC identifier of the RTP stream
kindstringThe kind of media (‘audio’ or ‘video’)
transportIdstring (optional)The ID of the transport associated with this stream
codecIdstring (optional)The ID of the codec used for this stream
packetsSentnumber (optional)The total number of packets sent
bytesSentnumber (optional)The total number of bytes sent
localIdstring (optional)The ID of the local inbound RTP stream
remoteTimestampnumber (optional)The timestamp from the remote peer
reportsSentnumber (optional)The number of RTCP sender reports sent
roundTripTimenumber (optional)The round trip time in seconds
totalRoundTripTimenumber (optional)The total round trip time
roundTripTimeMeasurementsnumber (optional)The number of round trip time measurements
attachmentsRecord<string, unknown> (optional)Additional information attached to this stats

MediaPlayoutStats

Statistics for media playout.

FieldTypeDescription
timestampnumberThe timestamp when the stats were generated
idstringThe unique identifier for the stats object
kindstringThe kind of media (‘audio’ or ‘video’)
synthesizedSamplesDurationnumber (optional)The duration of synthesized samples in seconds
synthesizedSamplesEventsnumber (optional)The number of synthesized sample events
totalSamplesDurationnumber (optional)The total duration of samples in seconds
totalPlayoutDelaynumber (optional)The total playout delay in seconds
totalSamplesCountnumber (optional)The total number of samples
attachmentsRecord<string, unknown> (optional)Additional information attached to this stats

PeerConnectionTransportStats

Statistics for peer connection transports.

FieldTypeDescription
timestampnumberThe timestamp when the stats were generated
idstringThe unique identifier for the stats object
packetsSentnumber (optional)The total number of packets sent
packetsReceivednumber (optional)The total number of packets received
bytesSentnumber (optional)The total number of bytes sent
bytesReceivednumber (optional)The total number of bytes received
rtcpPacketsSentnumber (optional)The total number of RTCP packets sent
rtcpPacketsReceivednumber (optional)The total number of RTCP packets received
rtcpBytesSentnumber (optional)The total number of RTCP bytes sent
rtcpBytesReceivednumber (optional)The total number of RTCP bytes received
iceRolestring (optional)The ICE role of the transport
dtlsStatestring (optional)The DTLS state of the transport
selectedCandidatePairIdstring (optional)The ID of the selected candidate pair
localCertificateIdstring (optional)The ID of the local certificate
remoteCertificateIdstring (optional)The ID of the remote certificate
tlsVersionstring (optional)The TLS version used
cipherstring (optional)The cipher used
srtpCipherstring (optional)The SRTP cipher used
tlsGroupstring (optional)The TLS group used
selectedCandidatePairChangesnumber (optional)The number of selected candidate pair changes
attachmentsRecord<string, unknown> (optional)Additional information attached to this stats

CertificateStats

Statistics for certificates used in the session.

FieldTypeDescription
timestampnumberThe timestamp when the stats were generated
idstringThe unique identifier for the stats object
fingerprintstring (optional)The fingerprint of the certificate
fingerprintAlgorithmstring (optional)The algorithm used to generate the fingerprint
base64Certificatestring (optional)The base64-encoded certificate
issuerCertificateIdstring (optional)The ID of the issuer certificate
subjectNamestring (optional)The subject name of the certificate
validFromnumber (optional)The start of the certificate’s validity period
validTonumber (optional)The end of the certificate’s validity period
attachmentsRecord<string, unknown> (optional)Additional information attached to this stats

IceCandidateStats

Statistics for ICE candidates.

FieldTypeDescription
timestampnumberThe timestamp when the stats were generated
idstringThe unique identifier for the stats object
transportIdstring (optional)The ID of the transport associated with this candidate
candidateTypestring (optional)The type of ICE candidate
protocolstring (optional)The protocol used by the ICE candidate
addressstring (optional)The IP address of the ICE candidate
portnumber (optional)The port number of the ICE candidate
prioritynumber (optional)The priority of the ICE candidate
urlstring (optional)The URL of the ICE candidate
relatedAddressstring (optional)The related IP address of the ICE candidate
relatedPortnumber (optional)The related port number of the ICE candidate
usernameFragmentstring (optional)The username fragment of the ICE candidate
attachmentsRecord<string, unknown> (optional)Additional information attached to this stats

IceTransportStats

Statistics for ICE transports.

FieldTypeDescription
timestampnumberThe timestamp when the stats were generated
idstringThe unique identifier for the stats object
packetsSentnumber (optional)The total number of packets sent
packetsReceivednumber (optional)The total number of packets received
bytesSentnumber (optional)The total number of bytes sent
bytesReceivednumber (optional)The total number of bytes received
iceStatestring (optional)The ICE state of the transport
localCandidateIdstring (optional)The ID of the local ICE candidate
remoteCandidateIdstring (optional)The ID of the remote ICE candidate
selectedCandidatePairIdstring (optional)The ID of the selected candidate pair
localCertificateIdstring (optional)The ID of the local certificate
remoteCertificateIdstring (optional)The ID of the remote certificate
tlsVersionstring (optional)The TLS version used
dtlsCipherstring (optional)The DTLS cipher used
srtpCipherstring (optional)The SRTP cipher used
tlsGroupstring (optional)The TLS group used
selectedCandidatePairChangesnumber (optional)The number of selected candidate pair changes
attachmentsRecord<string, unknown> (optional)Additional information attached to this stats

ClientEvent

Represents a client event.

FieldTypeDescription
timestampnumberThe timestamp when the event occurred
typestringThe type of the event
descriptionstring (optional)A description of the event
attachmentsRecord<string, unknown> (optional)Additional information attached to this event

ClientIssue

Represents a client issue.

FieldTypeDescription
timestampnumberThe timestamp when the issue occurred
typestringThe type of the issue
descriptionstring (optional)A description of the issue
attachmentsRecord<string, unknown> (optional)Additional information attached to this issue

ClientMetaData

Represents additional client metadata.

FieldTypeDescription
timestampnumberThe timestamp when the metadata was generated
typestringThe type of the metadata
descriptionstring (optional)A description of the metadata
attachmentsRecord<string, unknown> (optional)Additional information attached to this metadata

ExtensionStat

Represents a custom WebRTC app provided stats payload.

FieldTypeDescription
timestampnumberThe timestamp when the stats were generated
idstringThe unique identifier for the stats object
payloadRecord<string, unknown>The custom stats payload
attachmentsRecord<string, unknown> (optional)Additional information attached to this stats