ClientSample reference

ClientSample is the object a client-side monitor produces and an observer consumes. It is the contract between client-monitor-js and observer-js, and the thing you store if you build your own pipeline.

Schema version 3.7.0

This page is generated from the 3.7.0 Avro sources. Fields added since 3.0.0 are marked inline. No field has ever been removed in the 3.x line; what changed since 3.3.0 is the type of the four payload fields and of scoreReasons. See the version history for what changed and when.

Shape at a glance

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

Three conventions run through the whole schema:

  • timestamp + id — every stats record carries the collection time and the identifier the browser assigned, so records can be correlated across samples.
  • attachments — every record has a free-form slot for your own data. This is how a track becomes “Alice’s screen share” rather than an opaque SSRC.
  • score + scoreReasons — clients, peer connections and tracks can carry a computed 0–5 quality score with a machine-readable explanation.

Top level

ClientSample

The root object. One ClientSample is a snapshot of one participant at one point in time.

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 scoreReasons)
scoreReasonsRecord<string, number>
optional
Reasons for the score calculation, mapping each reason to how much it contributed changed in 3.6.0
peerConnectionsPeerConnectionSample[]
optional
Samples taken 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

Everything observed on a single RTCPeerConnection during the sampling interval.

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 scoreReasons)
scoreReasonsRecord<string, number>
optional
Reasons for the score calculation, mapping each reason to how much it contributed changed in 3.6.0
inboundTracksInboundTrackSample[]
optional
Inbound Track Stats items
outboundTracksOutboundTrackSample[]
optional
Outbound Track Stats items
codecsCodecStats[]
optional
Codec items
inboundRtpsInboundRtpStats[]
optional
Inbound RTP Stats
remoteInboundRtpsRemoteInboundRtpStats[]
optional
Remote Inbound RTP Stats
outboundRtpsOutboundRtpStats[]
optional
Outbound RTP Stats
remoteOutboundRtpsRemoteOutboundRtpStats[]
optional
Remote Outbound RTP Stats
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
Certificate Stats

Tracks

InboundTrackSample

A received media track, scored by the client.

FieldTypeDescription
timestampnumberThe timestamp when the stats were generated.
idstringThe unique identifier for the stats object.
kindstringKind of the media (e.g., ‘audio’ or ‘video’).
scorenumber
optional
Calculated score for track (details should be added to scoreReasons)
scoreReasonsRecord<string, number>
optional
Reasons for the score calculation, mapping each reason to how much it contributed changed in 3.6.0
attachmentsRecord<string, unknown>
optional
Additional information attached to this stats

OutboundTrackSample

A sent media track, scored by the client.

FieldTypeDescription
timestampnumberThe timestamp when the stats were generated.
idstringThe unique identifier for the stats object.
kindstringKind of the media (e.g., ‘audio’ or ‘video’).
scorenumber
optional
Calculated score for track (details should be added to scoreReasons)
scoreReasonsRecord<string, number>
optional
Reasons for the score calculation, mapping each reason to how much it contributed changed in 3.6.0
attachmentsRecord<string, unknown>
optional
Additional information attached to this stats

RTP statistics

InboundRtpStats

Receiving side of one RTP stream (inbound-rtp).

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.
packetsReceivedWithEct1number
optional
Total number of RTP packets received for this SSRC marked with the ECT(1) marking. new in 3.2.0
packetsReceivedWithCenumber
optional
Total number of RTP packets received for this SSRC marked with the CE marking. new in 3.2.0
packetsReportedAsLostnumber
optional
Total number of RTP packets for which an RFC8888 report has been sent with a zero R bit. new in 3.2.0
packetsReportedAsLostButRecoverednumber
optional
Total number of RTP packets reported as lost but later recovered in a subsequent RFC8888 report. new in 3.2.0
packetsLostnumber
optional
Number of packets lost on the RTP stream.
jitternumber
optional
Jitter of the RTP stream in seconds.
midstring
optional
The media stream identification tag from the SDP media section.
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 received.
firCountnumber
optional
Number of Full Intra Requests received.
pliCountnumber
optional
Number of Picture Loss Indications received.
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.
framesAssembledFromMultiplePacketsnumber
optional
Number of frames assembled from multiple packets.
totalAssemblyTimenumber
optional
Total assembly time for frames in seconds.
retransmittedPacketsReceivednumber
optional
Number of retransmitted packets received.
retransmittedBytesReceivednumber
optional
Number of retransmitted bytes received.
rtxSsrcnumber
optional
SSRC of the retransmission stream.
fecSsrcnumber
optional
SSRC of the FEC stream.
totalCorruptionProbabilitynumber
optional
Total corruption probability of packets.
totalSquaredCorruptionProbabilitynumber
optional
Total squared corruption probability of packets.
corruptionMeasurementsnumber
optional
Number of corruption measurements.
attachmentsRecord<string, unknown>
optional
Additional information attached to this stats

OutboundRtpStats

Sending side of one RTP stream (outbound-rtp).

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.
encodingIndexnumber
optional
Index of the encoding in the encoding array. new in 3.2.0
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.
psnrSumPsnrSum
optional
Cumulative PSNR measurements for Y, U, V components. new in 3.2.0
psnrMeasurementsnumber
optional
Total number of PSNR measurements collected. new in 3.2.0
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 (e.g., ‘cpu’, ‘bandwidth’, ‘other’).
qualityLimitationDurationsQualityLimitationDurations
optional
The duration of quality limitation reasons categorized by type. new in 3.2.0
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.
packetsSentWithEct1number
optional
Number of packets sent with ECT(1) congestion marking. new in 3.2.0
attachmentsRecord<string, unknown>
optional
Additional information attached to this stats.

RemoteInboundRtpStats

The remote peer’s view of what we send (remote-inbound-rtp, from RTCP Receiver Reports).

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.
packetsReceivednumber
optional
The total number of packets received on this stream.
packetsReceivedWithEct1number
optional
Total number of RTP packets received for this SSRC marked with the ECT(1) marking. new in 3.2.0
packetsReceivedWithCenumber
optional
Total number of RTP packets received for this SSRC marked with the CE marking. new in 3.2.0
packetsReportedAsLostnumber
optional
Total number of RTP packets for which an RFC8888 report has been sent with a zero R bit. new in 3.2.0
packetsReportedAsLostButRecoverednumber
optional
Total number of RTP packets reported as lost but later recovered in a subsequent RFC8888 report. new in 3.2.0
packetsLostnumber
optional
The total number of packets lost on this stream.
jitternumber
optional
The jitter value for this stream in seconds.
localIdstring
optional
The ID of the local object corresponding to this remote stream.
roundTripTimenumber
optional
The most recent RTT measurement for this stream in seconds.
totalRoundTripTimenumber
optional
The cumulative RTT for all packets on this stream in seconds.
fractionLostnumber
optional
The fraction of packets lost on this stream, calculated over a time interval.
roundTripTimeMeasurementsnumber
optional
The total number of RTT measurements for this stream.
packetsWithBleachedEct1Markingnumber
optional
Number of packets with ECT(1) marking that were bleached by a middlebox. new in 3.2.0
attachmentsRecord<string, unknown>
optional
Additional information attached to this stats

RemoteOutboundRtpStats

The remote peer’s view of what it sends us (remote-outbound-rtp, from RTCP Sender Reports).

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.
localIdstring
optional
The ID of the local object corresponding to this stream.
remoteTimestampnumber
optional
The remote timestamp for this stats object in DOMHighResTimeStamp format.
reportsSentnumber
optional
The total number of reports sent on this stream.
roundTripTimenumber
optional
The current estimated round-trip time for this stream in seconds.
totalRoundTripTimenumber
optional
The total round-trip time for this stream in seconds.
roundTripTimeMeasurementsnumber
optional
The total number of round-trip time measurements for this stream.
attachmentsRecord<string, unknown>
optional
Additional information attached to this stats

QualityLimitationDurations

Cumulative seconds spent in each quality-limitation state, nested inside OutboundRtpStats.

FieldTypeDescription
nonenumberDuration of no quality limitation in seconds.
cpunumberDuration of CPU-based quality limitation in seconds.
bandwidthnumberDuration of bandwidth-based quality limitation in seconds.
othernumberDuration of other quality limitation reasons in seconds.

PsnrSum

Cumulative per-plane PSNR, nested inside OutboundRtpStats.

FieldTypeDescription
ynumberPSNR value for the Y (luminance) component.
unumberPSNR value for the U (chrominance) component.
vnumberPSNR value for the V (chrominance) component.

Media

MediaSourceStats

A local capture source (media-source) feeding one or more outbound RTP streams.

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

MediaPlayoutStats

Audio playout path (media-playout) — where synthesized/stretched samples show up.

FieldTypeDescription
timestampnumberThe timestamp of the stat.
idstringA unique identifier for the stat.
kindstringThe kind of media (audio/video).
synthesizedSamplesDurationnumber
optional
The duration of synthesized audio samples.
synthesizedSamplesEventsnumber
optional
The number of synthesized audio samples events.
totalSamplesDurationnumber
optional
The total duration of all audio samples.
totalPlayoutDelaynumber
optional
The total delay experienced during audio playout.
totalSamplesCountnumber
optional
The total count of audio samples.
attachmentsRecord<string, unknown>
optional
Additional information attached to this stats

CodecStats

A negotiated codec (codec).

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

Transport & connectivity

PeerConnectionTransportStats

Peer-connection level data channel counters (peer-connection).

FieldTypeDescription
timestampnumberThe timestamp of the stat.
idstringA unique identifier for the stat.
dataChannelsOpenednumber
optional
The number of data channels opened.
dataChannelsClosednumber
optional
The number of data channels closed.
attachmentsRecord<string, unknown>
optional
Additional information attached to this stats

DataChannelStats

One RTCDataChannel (data-channel).

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

IceTransportStats

ICE/DTLS transport (transport).

FieldTypeDescription
timestampnumberThe timestamp of the stat.
idstringA unique identifier for the stat.
packetsSentnumber
optional
The number of packets sent.
packetsReceivednumber
optional
The number of packets received.
bytesSentnumber
optional
The number of bytes sent.
bytesReceivednumber
optional
The number of bytes received.
iceRolestring
optional
The ICE role (e.g., ‘controlling’, ‘controlled’).
iceLocalUsernameFragmentstring
optional
The local username fragment for ICE.
dtlsStatestring
optional
The DTLS transport state (e.g., ’new’, ‘connecting’, ‘connected’).
iceStatestring
optional
The ICE transport state (e.g., ’new’, ‘checking’, ‘connected’).
selectedCandidatePairIdstring
optional
The ID of the selected ICE candidate pair.
localCertificateIdstring
optional
The ID of the local certificate.
remoteCertificateIdstring
optional
The ID of the remote certificate.
tlsVersionstring
optional
The TLS version used for encryption.
dtlsCipherstring
optional
The DTLS cipher suite used.
dtlsRolestring
optional
The role in the DTLS handshake (e.g., ‘client’, ‘server’).
srtpCipherstring
optional
The SRTP cipher used for encryption.
selectedCandidatePairChangesnumber
optional
The number of changes to the selected ICE candidate pair.
ccfbMessagesSentnumber
optional
Number of congestion control feedback (CCFB) messages sent on this transport. new in 3.2.0
ccfbMessagesReceivednumber
optional
Number of congestion control feedback (CCFB) messages received on this transport. new in 3.2.0
attachmentsRecord<string, unknown>
optional
Additional information attached to this stats.

IceCandidateStats

One local or remote ICE candidate (local-candidate / remote-candidate).

FieldTypeDescription
timestampnumberThe timestamp of the stat.
idstringA unique identifier for the stat.
transportIdstring
optional
The transport ID associated with the ICE candidate.
addressstring
optional
The IP address of the ICE candidate.
portnumber
optional
The port number of the ICE candidate.
protocolstring
optional
The transport protocol used by the candidate (e.g., ‘udp’, ’tcp’).
candidateTypestring
optional
The type of the ICE candidate (e.g., ‘host’, ‘srflx’, ‘relay’).
prioritynumber
optional
The priority of the ICE candidate.
urlstring
optional
The URL of the ICE candidate.
relayProtocolstring
optional
The protocol used for the relay (e.g., ’tcp’, ‘udp’).
foundationstring
optional
A string representing the foundation for the ICE candidate.
relatedAddressstring
optional
The related address for the ICE candidate (if any).
relatedPortnumber
optional
The related port for the ICE candidate (if any).
usernameFragmentstring
optional
The username fragment for the ICE candidate.
tcpTypestring
optional
The TCP type of the ICE candidate (e.g., ‘active’, ‘passive’).
attachmentsRecord<string, unknown>
optional
Additional information attached to this stats

IceCandidatePairStats

One ICE candidate pair (candidate-pair) — where RTT and bandwidth estimates live.

FieldTypeDescription
idstringThe unique identifier for this RTCStats object.
timestampnumberThe timestamp of when the stats were recorded, in milliseconds.
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.
state"new" | "frozen" | "in-progress" | "waiting" | "failed" | "succeeded" | "cancelled" | "inprogress"
optional
The checklist state of this candidate pair. Values follow the W3C RTCStatsIceCandidatePairState enum (frozen, waiting, in-progress, failed, succeeded). Two further values are accepted for backward compatibility and are not part of the current spec: new (never standardised) and cancelled (removed from the spec after 2016).
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

CertificateStats

A DTLS certificate (certificate).

FieldTypeDescription
timestampnumberThe timestamp of the stat.
idstringA unique identifier for the stat.
fingerprintstring
optional
The fingerprint of the certificate.
fingerprintAlgorithmstring
optional
The algorithm used for the fingerprint (e.g., ‘SHA-256’).
base64Certificatestring
optional
The certificate encoded in base64 format.
issuerCertificateIdstring
optional
The certificate ID of the issuer.
attachmentsRecord<string, unknown>
optional
Additional information attached to this stats

Application-level payloads

ClientEvent

A discrete thing that happened on the client (joined, track added, ICE state change, …).

FieldTypeDescription
typestringThe name of the event used as an identifier (e.g., MEDIA_TRACK_MUTED, USER_REJOINED, etc.).
payloadRecord<string, unknown>
optional
Free-form JSON associated with the event. Was a pre-serialised string before 3.5.0, a flat record of primitives in 3.5.0–3.6.0 changed in 3.7.0
timestampnumber
optional
The timestamp in epoch format when the event was generated.

ClientIssue

A problem state reported by the client, with an optional key tying a raise to its resolution.

FieldTypeDescription
typestringThe name of the issue
keystring
optional
Identifier of the related issue or resolution when it is provided. new in 3.3.0
payloadRecord<string, unknown>
optional
Free-form JSON associated with the issue changed in 3.7.0
timestampnumber
optional
The timestamp in epoch format when the event was generated.

ClientMetaData

Environment and device information (browser, OS, media devices, SDP, …).

FieldTypeDescription
typestringThe name of the event used as an identifier (e.g., MEDIA_TRACK_MUTED, USER_REJOINED, etc.).
payloadRecord<string, unknown>
optional
Free-form JSON associated with the meta item changed in 3.7.0
peerConnectionIdstring
optional
The unique identifier of the peer connection for which the event was generated.
trackIdstring
optional
The identifier of the media track related to the event, if applicable.
ssrcnumber
optional
The SSRC (Synchronization Source) identifier associated with the event, if applicable.
timestampnumber
optional
The timestamp in epoch format when the event was generated.

ExtensionStat

Free-form application statistics carried alongside the WebRTC stats.

FieldTypeDescription
typestringThe type of the extension stats the custom app provides
payloadRecord<string, unknown>
optional
Free-form JSON provided by the application changed in 3.7.0

Notes on selected fields

payload fields are free-form JSON, and have been through three shapes

ClientEvent.payload, ClientIssue.payload, ClientMetaData.payload and ExtensionStat.payload are Record<string, unknown> as of 3.7.0, so a payload may nest objects and arrays freely — structured context such as { device: { os: { name, version } } } no longer has to be flattened into dotted keys or stringified into one field.

GenerationPayload shape
pre-3.5.0A pre-serialised JSON string
3.5.0 – 3.6.0A flat record of primitives — Record<string, boolean | string | number>
3.7.0Free-form JSON — Record<string, unknown>

A fleet does not have to move in step. observer-js passes an object through untouched and parses a string, so an old client and a new one produce the same object downstream.

Reading a payload value now needs narrowing: payload.role was boolean | string | number and is unknown, so String(payload.role) or a type guard replaces a bare read. Writers need no change — everything that was valid before still is.

attachments is free-form JSON too

It has been Record<string, unknown> since it stopped being a string, and it is the model the payload fields caught up with in 3.7.0.

Non-finite numbers are rejected, not silently nulled

Both codecs walk an opaque value before copying it and reject a NaN, an Infinity or a bigint anywhere inside a payload or attachments, reporting the path that reached it. JSON.stringify would have turned the first two into null without complaint.

ECN and RFC 8888 counters

packetsReceivedWithEct1, packetsReceivedWithCe, packetsReportedAsLost, packetsReportedAsLostButRecovered, packetsSentWithEct1 and packetsWithBleachedEct1Marking support Explicit Congestion Notification and RFC 8888 congestion control feedback. They are only populated by browsers that implement L4S-style congestion signalling — treat them as optional everywhere.

IceCandidatePairStats.state

The schema keeps two values that are no longer in the W3C enum, so older clients keep validating: new (never standardised) and cancelled (removed after w3c/webrtc-stats#66). The current spec values are frozen, waiting, in-progress, failed, succeeded.