Monitoring call quality in a WebRTC application is harder than it looks. You need consistent telemetry, enough context to interpret what you’re seeing, and dashboards that are actually useful when something goes wrong in production.
This post covers how we integrated Peermetrics into an Amazon IVS Real-Time Streaming application to get reliable, per-session call quality monitoring, including the specific wrapper approach that makes it work given how IVS exposes WebRTC connections.
This is a follow-up to our recent post on Migrating a Video Conferencing Application to Amazon IVS Real-Time Streaming.
Why Peermetrics for WebRTC Analytics
Peermetrics is a comprehensive WebRTC analytics platform designed to help developers monitor, analyze, and optimize their real-time communication applications. WebRTC.ventures acquired this open source project in 2025 because it filled an important gap in the WebRTC ecosystem. Call quality monitoring in WebRTC apps is deceptively hard. You need:
- consistent telemetry collection across sessions,
- enough context to interpret metrics correctly, and
- dashboards that are useful to both developers and product teams.
Building all of that from scratch is a major lift. Peermetrics provides a proven foundation to bring into our Amazon IVS workflow.
Peermetrics-Amazon IVS Integration Strategy
We had two practical constraints:
- Peermetrics does not provide an out-of-the-box integration for amazon-ivs-web-broadcast.
- Amazon IVS Real-Time does not expose
RTCPeerConnectiondirectly in the way some other SDKs do.
So the integration Peermetrics-Amazon IVS strategy was:
- hook into
RTCPeerConnectioncreation, - register each new connection with Peermetrics,
- manage lifecycle and cleanup correctly.
Core Implementation Approach
We initialize Peermetrics with normal session metadata (user, conference, app version), then wrap window.RTCPeerConnection so we can capture connections created by the IVS SDK.
// PeerMetrics initialization - app injects relevant values
peerMetricsInstance = new PeerMetrics({
apiRoot: 'https://api.example.com/v1',
apiKey: '<YOUR_API_KEY>',
userId,
userName,
conferenceId,
conferenceName,
appVersion: '1.0.1'
})
// Wrapper Implementation
// Keep reference to the real RTCPeerConnection constructor
const OriginalRTCPeerConnection = window.RTCPeerConnection
const WrappedRTCPeerConnection = function (
this: RTCPeerConnection,
configuration?: RTCConfiguration
): RTCPeerConnection {
const pc = new OriginalRTCPeerConnection(configuration)
// Now register pc to PeerMetrics
peerMetricsInstance.addConnection({
pc,
peerId: 'ivs-sfu-server',
peerName: 'IVS SFU Server',
isSfu: true
})
return pc
}
WrappedRTCPeerConnection.prototype = OriginalRTCPeerConnection.prototype
// This is the drawback of the implementation of the wrapper
// We have to keep track of properties and define them for the wrapper
Object.defineProperty(WrappedRTCPeerConnection, 'generateCertificate', {
value: OriginalRTCPeerConnection.generateCertificate,
writable: true,
configurable: true
})
window.RTCPeerConnection = WrappedRTCPeerConnection
From this implementation we now have clients properly registering and sending data to our peermetrics deployment:
Practical Improvements
Beyond the basic wrapper, a few implementation details made a big difference:
- Early install timing. We install the wrapper before any IVS SDK initialization, so we don’t miss early connection events.
- Connection labeling. We use stable stage oriented peer labels (for example, main vs screenshare paths) so graphs stay readable.
- Lifecycle hygiene. We call
endCall()during teardown so sessions close cleanly and data remains consistent.
Call Quality Metrics Available with this Integration
With this in place, we can monitor IVS session quality from the user side to the IVS SFU, including:
- round-trip time trends,
- throughput behavior,
- packet loss and jitter patterns,
- per-session/per-user quality context tied to conference metadata.
That has made incident triage faster and made it easier to validate improvements over time.
Wrapping Up: WebRTC Observability for Amazon IVS
With a small amount of targeted integration code, Peermetrics works well with Amazon IVS Real-Time and gives us meaningful production observability without building a full analytics platform from scratch.
Long term, it would be great to see first class IVS support directly in the Peermetrics JS SDK. Until then, the wrapper based approach is practical and effective.
Ready to Build with Amazon IVS Real-Time or Integrate Peermetrics into Your WebRTC Application?
At WebRTC.ventures, we work with teams building custom video products and integrations, helping them get to production with confidence.
If you’re evaluating Amazon IVS Real-Time Streaming for conferencing, collaboration, or hybrid live experiences, we can help you choose the right architecture and integration approach. Contact WebRTC.ventures to discuss your use case and next steps.
If you’re interested in adding a self-hosted Peermetrics implementation to help monitor, analyze, and optimize your real-time communication applications, reach out via the Peermetrics site.

Further Reading:

