Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/sip/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ func (c *inboundCall) handleInvite(ctx context.Context, tid traceid.ID, req *sip
c.call.SipCallId = h.Value()
}

c.mon.StartRingingDur().Observe(time.Since(c.callStart).Seconds())
c.cc.StartRinging()
// Send initial request. In the best case scenario, we will immediately get a room name to join.
// Otherwise, we could even learn that this number is not allowed and reject the call, or ask for pin if required.
Expand Down
14 changes: 14 additions & 0 deletions pkg/stats/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ type Monitor struct {
durCall *prometheus.HistogramVec
durJoin *prometheus.HistogramVec
durCheck *prometheus.HistogramVec
durStartRinging *prometheus.HistogramVec
cpuLoad prometheus.Gauge
sdpSize *prometheus.HistogramVec
nodeAvailable prometheus.GaugeFunc
Expand Down Expand Up @@ -214,6 +215,15 @@ func (m *Monitor) Start(conf *config.Config) error {
Buckets: durBucketsOp,
}, []string{"dir"}))

m.durStartRinging = mustRegister(m, prometheus.NewHistogramVec(prometheus.HistogramOpts{
Namespace: "livekit",
Subsystem: "sip",
Name: "dur_start_ringing_sec",
Help: "Duration from INVITE received to 180 Ringing sent",
ConstLabels: prometheus.Labels{"node_id": conf.NodeID},
Buckets: durBucketsOp,
}, []string{"dir"}))

m.durJoin = mustRegister(m, prometheus.NewHistogramVec(prometheus.HistogramOpts{
Namespace: "livekit",
Subsystem: "sip",
Expand Down Expand Up @@ -428,6 +438,10 @@ func (c *CallMonitor) CheckDur() prometheus.Observer {
return c.m.durCheck.With(c.labelsShort(nil))
}

func (c *CallMonitor) StartRingingDur() prometheus.Observer {
return c.m.durStartRinging.With(c.labelsShort(nil))
}

func (c *CallMonitor) JoinDur() func() time.Duration {
return prometheus.NewTimer(c.m.durJoin.With(c.labelsShort(nil))).ObserveDuration
}
Expand Down