Prometheus counters for RTC connection steps (#143)
* signal ws connection, participant join, ice connection * must register * offer negotiation * dz review: offer and offer_response * dz review: answer
This commit is contained in:
@@ -204,6 +204,7 @@ func (t *PCTransport) createAndSendOffer(options *webrtc.OfferOptions) error {
|
||||
if iceRestart && currentSD != nil {
|
||||
logger.Debugw("recovering from client negotiation state")
|
||||
if err := t.pc.SetRemoteDescription(*currentSD); err != nil {
|
||||
stats.PromServiceOperationCounter.WithLabelValues("offer", "error", "remote_description").Add(1)
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
@@ -218,12 +219,14 @@ func (t *PCTransport) createAndSendOffer(options *webrtc.OfferOptions) error {
|
||||
|
||||
offer, err := t.pc.CreateOffer(options)
|
||||
if err != nil {
|
||||
stats.PromServiceOperationCounter.WithLabelValues("offer", "error", "create").Add(1)
|
||||
logger.Errorw("could not create offer", err)
|
||||
return err
|
||||
}
|
||||
|
||||
err = t.pc.SetLocalDescription(offer)
|
||||
if err != nil {
|
||||
stats.PromServiceOperationCounter.WithLabelValues("offer", "error", "local_description").Add(1)
|
||||
logger.Errorw("could not set local description", err)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user