mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2026-03-14 14:35:44 +01:00
Add metrics for candidates and ICE, DTLS and PeerConnection states.
This commit is contained in:
parent
71fda2f258
commit
fa900132b4
3 changed files with 51 additions and 1 deletions
|
|
@ -60,3 +60,8 @@ The following metrics are available:
|
|||
| `signaling_mcu_backend_bandwidth` | Gauge | 2.0.5 | The current bandwidth of signaling proxy backends in bytes per second | `url`, `direction` |
|
||||
| `signaling_proxy_load` | Gauge | 2.0.5 | The current load of the signaling proxy | |
|
||||
| `signaling_client_rtt` | Histogram | 2.0.5 | The roundtrip time of WebSocket ping messages in milliseconds | |
|
||||
| `signaling_mcu_selected_local_candidate_total` | Counter | 2.0.5 | Total number of selected local candidates | `type`, `transport`, `family` |
|
||||
| `signaling_mcu_selected_remote_candidate_total` | Counter | 2.0.5 | Total number of selected local candidates | `type`, `transport`, `family` |
|
||||
| `signaling_mcu_peerconnection_state_total` | Counter | 2.0.5 | Total number PeerConnection states | `state`, `reason` |
|
||||
| `signaling_mcu_ice_state_total` | Counter | 2.0.5 | Total number of ICE connection states | `state` |
|
||||
| `signaling_mcu_dtls_state_total` | Counter | 2.0.5 | Total number of DTLS connection states | `state` |
|
||||
|
|
|
|||
|
|
@ -302,7 +302,8 @@ func (e JanusEventWebRTCDTLS) String() string {
|
|||
|
||||
// type=16, subtype=6
|
||||
type JanusEventWebRTCPeerConnection struct {
|
||||
Connection string `json:"connection"` // "webrtcup"
|
||||
Connection string `json:"connection"` // "webrtcup", "hangup"
|
||||
Reason string `json:"reason,omitempty"` // Only if "connection" == "hangup"
|
||||
}
|
||||
|
||||
func (e JanusEventWebRTCPeerConnection) String() string {
|
||||
|
|
@ -737,6 +738,15 @@ func (h *JanusEventsHandler) processEvent(event JanusEvent) {
|
|||
}
|
||||
|
||||
switch evt := evt.(type) {
|
||||
case *JanusEventWebRTCICE:
|
||||
statsJanusICEStateTotal.WithLabelValues(evt.ICE).Inc()
|
||||
case *JanusEventWebRTCDTLS:
|
||||
statsJanusDTLSStateTotal.WithLabelValues(evt.DTLS).Inc()
|
||||
case *JanusEventWebRTCPeerConnection:
|
||||
statsJanusPeerConnectionStateTotal.WithLabelValues(evt.Connection, evt.Reason).Inc()
|
||||
case *JanusEventWebRTCSelectedPair:
|
||||
statsJanusSelectedLocalCandidateTotal.WithLabelValues(evt.Candidates.Local.Type, evt.Candidates.Local.Transport, fmt.Sprintf("ipv%d", evt.Candidates.Local.Family)).Inc()
|
||||
statsJanusSelectedRemoteCandidateTotal.WithLabelValues(evt.Candidates.Remote.Type, evt.Candidates.Remote.Transport, fmt.Sprintf("ipv%d", evt.Candidates.Remote.Family)).Inc()
|
||||
case *JanusEventMediaStats:
|
||||
h.mcu.UpdateBandwidth(event.HandleId, evt.Media, api.BandwidthFromBytes(uint64(evt.BytesSentLastSec)), api.BandwidthFromBytes(uint64(evt.BytesReceivedLastSec)))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,9 +92,44 @@ var (
|
|||
Name: "bandwidth",
|
||||
Help: "The current bandwidth in bytes per second",
|
||||
}, []string{"direction"})
|
||||
statsJanusSelectedLocalCandidateTotal = prometheus.NewCounterVec(prometheus.CounterOpts{
|
||||
Namespace: "signaling",
|
||||
Subsystem: "mcu",
|
||||
Name: "selected_local_candidate_total",
|
||||
Help: "Total number of selected local candidates",
|
||||
}, []string{"type", "transport", "family"})
|
||||
statsJanusSelectedRemoteCandidateTotal = prometheus.NewCounterVec(prometheus.CounterOpts{
|
||||
Namespace: "signaling",
|
||||
Subsystem: "mcu",
|
||||
Name: "selected_remote_candidate_total",
|
||||
Help: "Total number of selected remote candidates",
|
||||
}, []string{"type", "transport", "family"})
|
||||
statsJanusPeerConnectionStateTotal = prometheus.NewCounterVec(prometheus.CounterOpts{
|
||||
Namespace: "signaling",
|
||||
Subsystem: "mcu",
|
||||
Name: "peerconnection_state_total",
|
||||
Help: "Total number of PeerConnections states",
|
||||
}, []string{"state", "reason"})
|
||||
statsJanusICEStateTotal = prometheus.NewCounterVec(prometheus.CounterOpts{
|
||||
Namespace: "signaling",
|
||||
Subsystem: "mcu",
|
||||
Name: "ice_state_total",
|
||||
Help: "Total number of ICE connection states",
|
||||
}, []string{"state"})
|
||||
statsJanusDTLSStateTotal = prometheus.NewCounterVec(prometheus.CounterOpts{
|
||||
Namespace: "signaling",
|
||||
Subsystem: "mcu",
|
||||
Name: "dtls_state_total",
|
||||
Help: "Total number of DTLS connection states",
|
||||
}, []string{"state"})
|
||||
|
||||
janusMcuStats = []prometheus.Collector{
|
||||
statsJanusBandwidthCurrent,
|
||||
statsJanusSelectedLocalCandidateTotal,
|
||||
statsJanusSelectedRemoteCandidateTotal,
|
||||
statsJanusPeerConnectionStateTotal,
|
||||
statsJanusICEStateTotal,
|
||||
statsJanusDTLSStateTotal,
|
||||
}
|
||||
|
||||
statsConnectedProxyBackendsCurrent = prometheus.NewGaugeVec(prometheus.GaugeOpts{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue