Count request/response packets on both client and server side. (#4001)

Currently, the signal requests are counted on media side and signal
responses are counted on controller side. This does not provide the
granularity to check how many response messages each media node is
sending.

Seeing some cases where track subscriptions are slow under load. This
would be good to see if the media node is doing a lot of signal response
messages.
This commit is contained in:
Raja Subramanian
2025-10-14 16:58:36 +05:30
committed by GitHub
parent dd62eb0072
commit ca0d5ee972
8 changed files with 72 additions and 52 deletions
+2 -4
View File
@@ -229,10 +229,8 @@ func (s *LocalStore) ListAgentDispatches(ctx context.Context, roomName livekit.R
agentJobs := s.agentJobs[roomName]
var js []*livekit.Job
if agentJobs != nil {
for _, j := range agentJobs {
js = append(js, utils.CloneProto(j))
}
for _, j := range agentJobs {
js = append(js, utils.CloneProto(j))
}
var ds []*livekit.AgentDispatch
+2
View File
@@ -168,6 +168,8 @@ func (r *signalService) RelaySignal(stream psrpc.ServerStream[*rpc.RelaySignalRe
reqChan,
signalRequestMessageReader{},
r.config,
prometheus.RecordSignalResponseSuccess,
prometheus.RecordSignalResponseFailure,
)
l.Debugw("signal stream closed", "error", err)
+1 -1
View File
@@ -203,7 +203,7 @@ func statusReporterResponseSent(ctx context.Context) {
code = r.error.Code()
}
prometheus.TwirpRequestStatusCounter.WithLabelValues(r.service, r.method, statusFamily, string(code)).Add(1)
prometheus.RecordTwirpRequestStatus(r.service, r.method, statusFamily, code)
}
func statusReporterErrorReceived(ctx context.Context, e twirp.Error) context.Context {