From 1722c1c54bfd7ea2d5c2476930da8f6eadde9fe5 Mon Sep 17 00:00:00 2001 From: Takeshi NAMAO Date: Thu, 26 Sep 2024 11:11:16 +0900 Subject: [PATCH 1/8] =?UTF-8?q?ignored=20webhook=20=E3=81=AE=E3=83=A1?= =?UTF-8?q?=E3=83=88=E3=83=AA=E3=82=AF=E3=82=B9=E5=8F=8E=E9=9B=86=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- collector/sora_api.go | 3 +++ collector/webhook.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/collector/sora_api.go b/collector/sora_api.go index 7c8de64..3d0c882 100644 --- a/collector/sora_api.go +++ b/collector/sora_api.go @@ -35,10 +35,13 @@ type soraWebhookReport struct { TotalFailedAuthWebhook int64 `json:"total_failed_auth_webhook"` TotalSuccessfulSessionWebhook int64 `json:"total_successful_session_webhook"` TotalFailedSessionWebhook int64 `json:"total_failed_session_webhook"` + TotalIgnoredSessionWebhook int64 `json:"total_ignored_session_webhook"` TotalSuccessfulEventWebhook int64 `json:"total_successful_event_webhook"` TotalFailedEventWebhook int64 `json:"total_failed_event_webhook"` + TotalIgnoredEventWebhook int64 `json:"total_ignored_event_webhook"` TotalSuccessfulStatsWebhook int64 `json:"total_successful_stats_webhook"` TotalFailedStatsWebhook int64 `json:"total_failed_stats_webhook"` + TotalIgnoredStatsWebhook int64 `json:"total_ignored_stats_webhook"` } type soraClientStatistics struct { diff --git a/collector/webhook.go b/collector/webhook.go index d7c5cee..26ccf34 100644 --- a/collector/webhook.go +++ b/collector/webhook.go @@ -35,8 +35,11 @@ func (m *WebhookMetrics) Collect(ch chan<- prometheus.Metric, report soraWebhook ch <- newCounter(m.totalAuthWebhook, float64(report.TotalFailedAuthWebhook), "failed") ch <- newCounter(m.totalSessionWebhook, float64(report.TotalSuccessfulSessionWebhook), "successful") ch <- newCounter(m.totalSessionWebhook, float64(report.TotalFailedSessionWebhook), "failed") + ch <- newCounter(m.totalSessionWebhook, float64(report.TotalIgnoredSessionWebhook), "ignored") ch <- newCounter(m.totalEventWebhook, float64(report.TotalSuccessfulEventWebhook), "successful") ch <- newCounter(m.totalEventWebhook, float64(report.TotalFailedEventWebhook), "failed") + ch <- newCounter(m.totalEventWebhook, float64(report.TotalIgnoredEventWebhook), "ignored") ch <- newCounter(m.totalStatsWebhook, float64(report.TotalSuccessfulStatsWebhook), "successful") ch <- newCounter(m.totalStatsWebhook, float64(report.TotalFailedStatsWebhook), "failed") + ch <- newCounter(m.totalStatsWebhook, float64(report.TotalIgnoredStatsWebhook), "ignored") } From 56789489f06e331a7c407c33ecc083c17ea15d93 Mon Sep 17 00:00:00 2001 From: Takeshi NAMAO Date: Thu, 26 Sep 2024 11:11:36 +0900 Subject: [PATCH 2/8] =?UTF-8?q?ignored=20webhook=20=E3=83=A1=E3=83=88?= =?UTF-8?q?=E3=83=AA=E3=82=AF=E3=82=B9=E3=82=92=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=83=87=E3=83=BC=E3=82=BF=E3=81=AB=E8=BF=BD=E5=8A=A0=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main_test.go | 6 ++++++ test/maximum.metrics | 3 +++ test/minimum.metrics | 3 +++ test/sora_client_enabled.metrics | 3 +++ test/sora_cluster_metrics_enabled.metrics | 3 +++ test/sora_connection_error_enabled.metrics | 3 +++ test/sora_erlang_vm_enabled.metrics | 3 +++ 7 files changed, 24 insertions(+) diff --git a/main_test.go b/main_test.go index 9b43180..a172634 100644 --- a/main_test.go +++ b/main_test.go @@ -155,6 +155,9 @@ var ( "total_failed_event_webhook": 94, "total_failed_session_webhook": 95, "total_failed_stats_webhook": 99, + "total_ignored_event_webhook": 101, + "total_ignored_session_webhook": 102, + "total_ignored_stats_webhook": 103, "total_ongoing_connections": 0, "total_received_invalid_turn_tcp_packet": 0, "total_session_created": 1, @@ -411,6 +414,9 @@ func TestMinimumMetrics(t *testing.T) { "total_failed_event_webhook": 94, "total_failed_session_webhook": 95, "total_failed_stats_webhook": 99, + "total_ignored_event_webhook": 101, + "total_ignored_session_webhook": 102, + "total_ignored_stats_webhook": 103, "total_ongoing_connections": 88, "total_received_invalid_turn_tcp_packet": 123, "total_session_created": 111, diff --git a/test/maximum.metrics b/test/maximum.metrics index 602a210..c7f1977 100644 --- a/test/maximum.metrics +++ b/test/maximum.metrics @@ -164,6 +164,7 @@ sora_erlang_vm_wall_clock_wallclock_time_since_last_call 9090 # HELP sora_event_webhook_total The total number of event webhook. # TYPE sora_event_webhook_total counter sora_event_webhook_total{state="failed"} 94 +sora_event_webhook_total{state="ignored"} 101 sora_event_webhook_total{state="successful"} 97 # HELP sora_license_expired_at_timestamp_seconds sora license file's expire seconds since epoch. # TYPE sora_license_expired_at_timestamp_seconds gauge @@ -190,10 +191,12 @@ sora_session_total{state="destroyed"} 0 # HELP sora_session_webhook_total The total number of session webhook. # TYPE sora_session_webhook_total counter sora_session_webhook_total{state="failed"} 95 +sora_session_webhook_total{state="ignored"} 102 sora_session_webhook_total{state="successful"} 98 # HELP sora_stats_webhook_total The total number of stats webhook. # TYPE sora_stats_webhook_total counter sora_stats_webhook_total{state="failed"} 99 +sora_stats_webhook_total{state="ignored"} 103 sora_stats_webhook_total{state="successful"} 100 # HELP sora_successful_auth_webhook_total The total number of successful auth webhook. # TYPE sora_successful_auth_webhook_total counter diff --git a/test/minimum.metrics b/test/minimum.metrics index b88e5dd..f0b7572 100644 --- a/test/minimum.metrics +++ b/test/minimum.metrics @@ -21,6 +21,7 @@ sora_duration_seconds_total 1412 # HELP sora_event_webhook_total The total number of event webhook. # TYPE sora_event_webhook_total counter sora_event_webhook_total{state="failed"} 94 +sora_event_webhook_total{state="ignored"} 101 sora_event_webhook_total{state="successful"} 97 # HELP sora_license_expired_at_timestamp_seconds sora license file's expire seconds since epoch. # TYPE sora_license_expired_at_timestamp_seconds gauge @@ -44,10 +45,12 @@ sora_session_total{state="destroyed"} 222 # HELP sora_session_webhook_total The total number of session webhook. # TYPE sora_session_webhook_total counter sora_session_webhook_total{state="failed"} 95 +sora_session_webhook_total{state="ignored"} 102 sora_session_webhook_total{state="successful"} 98 # HELP sora_stats_webhook_total The total number of stats webhook. # TYPE sora_stats_webhook_total counter sora_stats_webhook_total{state="failed"} 99 +sora_stats_webhook_total{state="ignored"} 103 sora_stats_webhook_total{state="successful"} 100 # HELP sora_successful_auth_webhook_total The total number of successful auth webhook. # TYPE sora_successful_auth_webhook_total counter diff --git a/test/sora_client_enabled.metrics b/test/sora_client_enabled.metrics index 0b2877a..50e5caf 100644 --- a/test/sora_client_enabled.metrics +++ b/test/sora_client_enabled.metrics @@ -49,6 +49,7 @@ sora_duration_seconds_total 1412 # HELP sora_event_webhook_total The total number of event webhook. # TYPE sora_event_webhook_total counter sora_event_webhook_total{state="failed"} 94 +sora_event_webhook_total{state="ignored"} 101 sora_event_webhook_total{state="successful"} 97 # HELP sora_license_expired_at_timestamp_seconds sora license file's expire seconds since epoch. # TYPE sora_license_expired_at_timestamp_seconds gauge @@ -75,10 +76,12 @@ sora_session_total{state="destroyed"} 0 # HELP sora_session_webhook_total The total number of session webhook. # TYPE sora_session_webhook_total counter sora_session_webhook_total{state="failed"} 95 +sora_session_webhook_total{state="ignored"} 102 sora_session_webhook_total{state="successful"} 98 # HELP sora_stats_webhook_total The total number of stats webhook. # TYPE sora_stats_webhook_total counter sora_stats_webhook_total{state="failed"} 99 +sora_stats_webhook_total{state="ignored"} 103 sora_stats_webhook_total{state="successful"} 100 # HELP sora_successful_auth_webhook_total The total number of successful auth webhook. # TYPE sora_successful_auth_webhook_total counter diff --git a/test/sora_cluster_metrics_enabled.metrics b/test/sora_cluster_metrics_enabled.metrics index 31b9f3e..cf52f70 100644 --- a/test/sora_cluster_metrics_enabled.metrics +++ b/test/sora_cluster_metrics_enabled.metrics @@ -51,6 +51,7 @@ sora_duration_seconds_total 1412 # HELP sora_event_webhook_total The total number of event webhook. # TYPE sora_event_webhook_total counter sora_event_webhook_total{state="failed"} 94 +sora_event_webhook_total{state="ignored"} 101 sora_event_webhook_total{state="successful"} 97 # HELP sora_license_expired_at_timestamp_seconds sora license file's expire seconds since epoch. # TYPE sora_license_expired_at_timestamp_seconds gauge @@ -77,10 +78,12 @@ sora_session_total{state="destroyed"} 0 # HELP sora_session_webhook_total The total number of session webhook. # TYPE sora_session_webhook_total counter sora_session_webhook_total{state="failed"} 95 +sora_session_webhook_total{state="ignored"} 102 sora_session_webhook_total{state="successful"} 98 # HELP sora_stats_webhook_total The total number of stats webhook. # TYPE sora_stats_webhook_total counter sora_stats_webhook_total{state="failed"} 99 +sora_stats_webhook_total{state="ignored"} 103 sora_stats_webhook_total{state="successful"} 100 # HELP sora_successful_auth_webhook_total The total number of successful auth webhook. # TYPE sora_successful_auth_webhook_total counter diff --git a/test/sora_connection_error_enabled.metrics b/test/sora_connection_error_enabled.metrics index 105a911..9a5a0f8 100644 --- a/test/sora_connection_error_enabled.metrics +++ b/test/sora_connection_error_enabled.metrics @@ -25,6 +25,7 @@ sora_duration_seconds_total 1412 # HELP sora_event_webhook_total The total number of event webhook. # TYPE sora_event_webhook_total counter sora_event_webhook_total{state="failed"} 94 +sora_event_webhook_total{state="ignored"} 101 sora_event_webhook_total{state="successful"} 97 # HELP sora_license_expired_at_timestamp_seconds sora license file's expire seconds since epoch. # TYPE sora_license_expired_at_timestamp_seconds gauge @@ -51,10 +52,12 @@ sora_session_total{state="destroyed"} 0 # HELP sora_session_webhook_total The total number of session webhook. # TYPE sora_session_webhook_total counter sora_session_webhook_total{state="failed"} 95 +sora_session_webhook_total{state="ignored"} 102 sora_session_webhook_total{state="successful"} 98 # HELP sora_stats_webhook_total The total number of stats webhook. # TYPE sora_stats_webhook_total counter sora_stats_webhook_total{state="failed"} 99 +sora_stats_webhook_total{state="ignored"} 103 sora_stats_webhook_total{state="successful"} 100 # HELP sora_successful_auth_webhook_total The total number of successful auth webhook. # TYPE sora_successful_auth_webhook_total counter diff --git a/test/sora_erlang_vm_enabled.metrics b/test/sora_erlang_vm_enabled.metrics index 0d91a4e..1a4101f 100644 --- a/test/sora_erlang_vm_enabled.metrics +++ b/test/sora_erlang_vm_enabled.metrics @@ -102,6 +102,7 @@ sora_erlang_vm_wall_clock_wallclock_time_since_last_call 9090 # HELP sora_event_webhook_total The total number of event webhook. # TYPE sora_event_webhook_total counter sora_event_webhook_total{state="failed"} 94 +sora_event_webhook_total{state="ignored"} 101 sora_event_webhook_total{state="successful"} 97 # HELP sora_license_expired_at_timestamp_seconds sora license file's expire seconds since epoch. # TYPE sora_license_expired_at_timestamp_seconds gauge @@ -128,10 +129,12 @@ sora_session_total{state="destroyed"} 0 # HELP sora_session_webhook_total The total number of session webhook. # TYPE sora_session_webhook_total counter sora_session_webhook_total{state="failed"} 95 +sora_session_webhook_total{state="ignored"} 102 sora_session_webhook_total{state="successful"} 98 # HELP sora_stats_webhook_total The total number of stats webhook. # TYPE sora_stats_webhook_total counter sora_stats_webhook_total{state="failed"} 99 +sora_stats_webhook_total{state="ignored"} 103 sora_stats_webhook_total{state="successful"} 100 # HELP sora_successful_auth_webhook_total The total number of successful auth webhook. # TYPE sora_successful_auth_webhook_total counter From 479fb9378aa30cca56868da1a6592ec133687b8b Mon Sep 17 00:00:00 2001 From: Takeshi NAMAO Date: Thu, 26 Sep 2024 12:28:58 +0900 Subject: [PATCH 3/8] =?UTF-8?q?SRTP=20=E3=81=AE=E3=83=A1=E3=83=88=E3=83=AA?= =?UTF-8?q?=E3=82=AF=E3=82=B9=E5=8F=8E=E9=9B=86=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- collector/collector.go | 4 ++++ collector/sora_api.go | 10 ++++++++++ collector/srtp.go | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 collector/srtp.go diff --git a/collector/collector.go b/collector/collector.go index 6fe9189..a40e75d 100644 --- a/collector/collector.go +++ b/collector/collector.go @@ -36,6 +36,7 @@ type Collector struct { ConnectionMetrics WebhookMetrics + SrtpMetrics ClientMetrics SoraConnectionErrorMetrics ErlangVMMetrics @@ -85,6 +86,7 @@ func NewCollector(options *CollectorOptions) *Collector { ConnectionMetrics: connectionMetrics, WebhookMetrics: webhookMetrics, + SrtpMetrics: srtpMetrics, ClientMetrics: clientMetrics, SoraConnectionErrorMetrics: soraConnectionErrorMetrics, ErlangVMMetrics: erlangVMMetrics, @@ -200,6 +202,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) { c.LicenseMetrics.Collect(ch, licenseInfo) c.ConnectionMetrics.Collect(ch, report.soraConnectionReport) c.WebhookMetrics.Collect(ch, report.soraWebhookReport) + c.SrtpMetrics.Collect(ch, report.soraSrtpReport) if c.enableSoraClientMetrics { c.ClientMetrics.Collect(ch, report.SoraClientReport) @@ -222,6 +225,7 @@ func (c *Collector) Describe(ch chan<- *prometheus.Desc) { c.LicenseMetrics.Describe(ch) c.ConnectionMetrics.Describe(ch) c.WebhookMetrics.Describe(ch) + c.SrtpMetrics.Describe(ch) if c.enableSoraClientMetrics { c.ClientMetrics.Describe(ch) diff --git a/collector/sora_api.go b/collector/sora_api.go index 3d0c882..4654622 100644 --- a/collector/sora_api.go +++ b/collector/sora_api.go @@ -4,6 +4,7 @@ type soraGetStatsReport struct { SoraVersion string `json:"version"` soraConnectionReport soraWebhookReport + soraSrtpReport SoraClientReport soraClientReport `json:"sora_client,omitempty"` SoraConnectionErrorReport soraConnectionErrorReport `json:"error,omitempty"` ErlangVMReport erlangVMReport `json:"erlang_vm,omitempty"` @@ -44,6 +45,15 @@ type soraWebhookReport struct { TotalIgnoredStatsWebhook int64 `json:"total_ignored_stats_webhook"` } +type soraSrtpReport struct { + TotalReceivedSrtp int64 `json:"total_received_srtp"` + TotalReceivedSrtpByteSize int64 `json:"total_received_srtp_byte_size"` + TotalSentSrtp int64 `json:"total_sent_srtp"` + TotalSentSrtpByteSize int64 `json:"total_sent_srtp_byte_size"` + TotalDecryptedSrtp int64 `json:"total_decrypted_srtp"` + TotalDecryptedSrtpByteSize int64 `json:"total_decrypted_srtp_byte_size"` +} + type soraClientStatistics struct { SoraAndroidSdk int64 `json:"sora_android_sdk"` SoraCSdk int64 `json:"sora_c_sdk"` diff --git a/collector/srtp.go b/collector/srtp.go new file mode 100644 index 0000000..36eaff6 --- /dev/null +++ b/collector/srtp.go @@ -0,0 +1,41 @@ +package collector + +import "github.com/prometheus/client_golang/prometheus" + +var ( + srtpMetrics = SrtpMetrics{ + totalReceivedSrtp: newDesc("srtp_received_packets_total", "The total number of received SRTP packets."), + totalReceivedSrtpByteSize: newDesc("srtp_received_bytes_total", "The total number of received SRTP bytes."), + totalSentSrtp: newDesc("srtp_sent_packets_total", "The total number of sent SRPT packets."), + totalSentSrtpByteSize: newDesc("srtp_sent_bytes_total", "The total number of sent SRTP bytes."), + totalDecryptedSrtp: newDesc("srtp_decrypted_packets_total", "The total number of decrpyted SRTP packets."), + totalDecryptedSrtpByteSize: newDesc("srtp_decrpyted_bytes_total", "The total number of decrypted SRTP bytes."), + } +) + +type SrtpMetrics struct { + totalReceivedSrtp *prometheus.Desc + totalReceivedSrtpByteSize *prometheus.Desc + totalSentSrtp *prometheus.Desc + totalSentSrtpByteSize *prometheus.Desc + totalDecryptedSrtp *prometheus.Desc + totalDecryptedSrtpByteSize *prometheus.Desc +} + +func (m *SrtpMetrics) Describe(ch chan<- *prometheus.Desc) { + ch <- m.totalReceivedSrtp + ch <- m.totalReceivedSrtpByteSize + ch <- m.totalSentSrtp + ch <- m.totalSentSrtpByteSize + ch <- m.totalDecryptedSrtp + ch <- m.totalDecryptedSrtpByteSize +} + +func (m *SrtpMetrics) Collect(ch chan<- prometheus.Metric, report soraSrtpReport) { + ch <- newCounter(m.totalReceivedSrtp, float64(report.TotalReceivedSrtp)) + ch <- newCounter(m.totalReceivedSrtpByteSize, float64(report.TotalReceivedSrtpByteSize)) + ch <- newCounter(m.totalSentSrtp, float64(report.TotalSentSrtp)) + ch <- newCounter(m.totalSentSrtpByteSize, float64(report.TotalSentSrtpByteSize)) + ch <- newCounter(m.totalDecryptedSrtp, float64(report.TotalDecryptedSrtp)) + ch <- newCounter(m.totalDecryptedSrtpByteSize, float64(report.TotalDecryptedSrtpByteSize)) +} From 5a8d15728b21930ac92d0d6f093dd1f4b69d3445 Mon Sep 17 00:00:00 2001 From: Takeshi NAMAO Date: Thu, 26 Sep 2024 12:29:15 +0900 Subject: [PATCH 4/8] =?UTF-8?q?SRTP=20=E3=83=A1=E3=83=88=E3=83=AA=E3=82=AF?= =?UTF-8?q?=E3=82=B9=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main_test.go | 12 ++++++++++++ test/maximum.metrics | 18 ++++++++++++++++++ test/minimum.metrics | 18 ++++++++++++++++++ test/sora_client_enabled.metrics | 18 ++++++++++++++++++ test/sora_cluster_metrics_enabled.metrics | 18 ++++++++++++++++++ test/sora_connection_error_enabled.metrics | 18 ++++++++++++++++++ test/sora_erlang_vm_enabled.metrics | 18 ++++++++++++++++++ 7 files changed, 120 insertions(+) diff --git a/main_test.go b/main_test.go index a172634..4e9187b 100644 --- a/main_test.go +++ b/main_test.go @@ -149,6 +149,8 @@ var ( "total_connection_created": 2, "total_connection_destroyed": 2, "total_connection_updated": 23, + "total_decrypted_srtp": 104, + "total_decrypted_srtp_byte_size": 105, "total_duration_sec": 1412, "total_failed_auth_webhook": 93, "total_failed_connections": 0, @@ -160,6 +162,8 @@ var ( "total_ignored_stats_webhook": 103, "total_ongoing_connections": 0, "total_received_invalid_turn_tcp_packet": 0, + "total_sent_srtp": 106, + "total_sent_srtp_byte_size": 107, "total_session_created": 1, "total_session_destroyed": 0, "total_successful_auth_webhook": 96, @@ -167,6 +171,8 @@ var ( "total_successful_event_webhook": 97, "total_successful_session_webhook": 98, "total_successful_stats_webhook": 100, + "total_received_srtp": 108, + "total_received_srtp_byte_size": 109, "total_turn_tcp_connections": 2, "total_turn_udp_connections": 0, "version": "2022.1.0-canary.28" @@ -408,6 +414,8 @@ func TestMinimumMetrics(t *testing.T) { "total_connection_created": 3, "total_connection_destroyed": 2, "total_connection_updated": 23, + "total_decrypted_srtp": 104, + "total_decrypted_srtp_byte_size": 105, "total_duration_sec": 1412, "total_failed_auth_webhook": 93, "total_failed_connections": 100, @@ -419,6 +427,8 @@ func TestMinimumMetrics(t *testing.T) { "total_ignored_stats_webhook": 103, "total_ongoing_connections": 88, "total_received_invalid_turn_tcp_packet": 123, + "total_sent_srtp": 106, + "total_sent_srtp_byte_size": 107, "total_session_created": 111, "total_session_destroyed": 222, "total_successful_auth_webhook": 96, @@ -426,6 +436,8 @@ func TestMinimumMetrics(t *testing.T) { "total_successful_event_webhook": 97, "total_successful_session_webhook": 98, "total_successful_stats_webhook": 100, + "total_received_srtp": 108, + "total_received_srtp_byte_size": 109, "total_turn_tcp_connections": 444, "total_turn_udp_connections": 555, "version": "2022.1.0-canary.28" diff --git a/test/maximum.metrics b/test/maximum.metrics index c7f1977..8ef8899 100644 --- a/test/maximum.metrics +++ b/test/maximum.metrics @@ -193,6 +193,24 @@ sora_session_total{state="destroyed"} 0 sora_session_webhook_total{state="failed"} 95 sora_session_webhook_total{state="ignored"} 102 sora_session_webhook_total{state="successful"} 98 +# HELP sora_srtp_decrpyted_bytes_total The total number of decrypted SRTP bytes. +# TYPE sora_srtp_decrpyted_bytes_total counter +sora_srtp_decrpyted_bytes_total 105 +# HELP sora_srtp_decrypted_packets_total The total number of decrpyted SRTP packets. +# TYPE sora_srtp_decrypted_packets_total counter +sora_srtp_decrypted_packets_total 104 +# HELP sora_srtp_received_bytes_total The total number of received SRTP bytes. +# TYPE sora_srtp_received_bytes_total counter +sora_srtp_received_bytes_total 109 +# HELP sora_srtp_received_packets_total The total number of received SRTP packets. +# TYPE sora_srtp_received_packets_total counter +sora_srtp_received_packets_total 108 +# HELP sora_srtp_sent_bytes_total The total number of sent SRTP bytes. +# TYPE sora_srtp_sent_bytes_total counter +sora_srtp_sent_bytes_total 107 +# HELP sora_srtp_sent_packets_total The total number of sent SRPT packets. +# TYPE sora_srtp_sent_packets_total counter +sora_srtp_sent_packets_total 106 # HELP sora_stats_webhook_total The total number of stats webhook. # TYPE sora_stats_webhook_total counter sora_stats_webhook_total{state="failed"} 99 diff --git a/test/minimum.metrics b/test/minimum.metrics index f0b7572..324193b 100644 --- a/test/minimum.metrics +++ b/test/minimum.metrics @@ -47,6 +47,24 @@ sora_session_total{state="destroyed"} 222 sora_session_webhook_total{state="failed"} 95 sora_session_webhook_total{state="ignored"} 102 sora_session_webhook_total{state="successful"} 98 +# HELP sora_srtp_decrpyted_bytes_total The total number of decrypted SRTP bytes. +# TYPE sora_srtp_decrpyted_bytes_total counter +sora_srtp_decrpyted_bytes_total 105 +# HELP sora_srtp_decrypted_packets_total The total number of decrpyted SRTP packets. +# TYPE sora_srtp_decrypted_packets_total counter +sora_srtp_decrypted_packets_total 104 +# HELP sora_srtp_received_bytes_total The total number of received SRTP bytes. +# TYPE sora_srtp_received_bytes_total counter +sora_srtp_received_bytes_total 109 +# HELP sora_srtp_received_packets_total The total number of received SRTP packets. +# TYPE sora_srtp_received_packets_total counter +sora_srtp_received_packets_total 108 +# HELP sora_srtp_sent_bytes_total The total number of sent SRTP bytes. +# TYPE sora_srtp_sent_bytes_total counter +sora_srtp_sent_bytes_total 107 +# HELP sora_srtp_sent_packets_total The total number of sent SRPT packets. +# TYPE sora_srtp_sent_packets_total counter +sora_srtp_sent_packets_total 106 # HELP sora_stats_webhook_total The total number of stats webhook. # TYPE sora_stats_webhook_total counter sora_stats_webhook_total{state="failed"} 99 diff --git a/test/sora_client_enabled.metrics b/test/sora_client_enabled.metrics index 50e5caf..94beff1 100644 --- a/test/sora_client_enabled.metrics +++ b/test/sora_client_enabled.metrics @@ -78,6 +78,24 @@ sora_session_total{state="destroyed"} 0 sora_session_webhook_total{state="failed"} 95 sora_session_webhook_total{state="ignored"} 102 sora_session_webhook_total{state="successful"} 98 +# HELP sora_srtp_decrpyted_bytes_total The total number of decrypted SRTP bytes. +# TYPE sora_srtp_decrpyted_bytes_total counter +sora_srtp_decrpyted_bytes_total 105 +# HELP sora_srtp_decrypted_packets_total The total number of decrpyted SRTP packets. +# TYPE sora_srtp_decrypted_packets_total counter +sora_srtp_decrypted_packets_total 104 +# HELP sora_srtp_received_bytes_total The total number of received SRTP bytes. +# TYPE sora_srtp_received_bytes_total counter +sora_srtp_received_bytes_total 109 +# HELP sora_srtp_received_packets_total The total number of received SRTP packets. +# TYPE sora_srtp_received_packets_total counter +sora_srtp_received_packets_total 108 +# HELP sora_srtp_sent_bytes_total The total number of sent SRTP bytes. +# TYPE sora_srtp_sent_bytes_total counter +sora_srtp_sent_bytes_total 107 +# HELP sora_srtp_sent_packets_total The total number of sent SRPT packets. +# TYPE sora_srtp_sent_packets_total counter +sora_srtp_sent_packets_total 106 # HELP sora_stats_webhook_total The total number of stats webhook. # TYPE sora_stats_webhook_total counter sora_stats_webhook_total{state="failed"} 99 diff --git a/test/sora_cluster_metrics_enabled.metrics b/test/sora_cluster_metrics_enabled.metrics index cf52f70..3b29678 100644 --- a/test/sora_cluster_metrics_enabled.metrics +++ b/test/sora_cluster_metrics_enabled.metrics @@ -80,6 +80,24 @@ sora_session_total{state="destroyed"} 0 sora_session_webhook_total{state="failed"} 95 sora_session_webhook_total{state="ignored"} 102 sora_session_webhook_total{state="successful"} 98 +# HELP sora_srtp_decrpyted_bytes_total The total number of decrypted SRTP bytes. +# TYPE sora_srtp_decrpyted_bytes_total counter +sora_srtp_decrpyted_bytes_total 105 +# HELP sora_srtp_decrypted_packets_total The total number of decrpyted SRTP packets. +# TYPE sora_srtp_decrypted_packets_total counter +sora_srtp_decrypted_packets_total 104 +# HELP sora_srtp_received_bytes_total The total number of received SRTP bytes. +# TYPE sora_srtp_received_bytes_total counter +sora_srtp_received_bytes_total 109 +# HELP sora_srtp_received_packets_total The total number of received SRTP packets. +# TYPE sora_srtp_received_packets_total counter +sora_srtp_received_packets_total 108 +# HELP sora_srtp_sent_bytes_total The total number of sent SRTP bytes. +# TYPE sora_srtp_sent_bytes_total counter +sora_srtp_sent_bytes_total 107 +# HELP sora_srtp_sent_packets_total The total number of sent SRPT packets. +# TYPE sora_srtp_sent_packets_total counter +sora_srtp_sent_packets_total 106 # HELP sora_stats_webhook_total The total number of stats webhook. # TYPE sora_stats_webhook_total counter sora_stats_webhook_total{state="failed"} 99 diff --git a/test/sora_connection_error_enabled.metrics b/test/sora_connection_error_enabled.metrics index 9a5a0f8..87e7d08 100644 --- a/test/sora_connection_error_enabled.metrics +++ b/test/sora_connection_error_enabled.metrics @@ -54,6 +54,24 @@ sora_session_total{state="destroyed"} 0 sora_session_webhook_total{state="failed"} 95 sora_session_webhook_total{state="ignored"} 102 sora_session_webhook_total{state="successful"} 98 +# HELP sora_srtp_decrpyted_bytes_total The total number of decrypted SRTP bytes. +# TYPE sora_srtp_decrpyted_bytes_total counter +sora_srtp_decrpyted_bytes_total 105 +# HELP sora_srtp_decrypted_packets_total The total number of decrpyted SRTP packets. +# TYPE sora_srtp_decrypted_packets_total counter +sora_srtp_decrypted_packets_total 104 +# HELP sora_srtp_received_bytes_total The total number of received SRTP bytes. +# TYPE sora_srtp_received_bytes_total counter +sora_srtp_received_bytes_total 109 +# HELP sora_srtp_received_packets_total The total number of received SRTP packets. +# TYPE sora_srtp_received_packets_total counter +sora_srtp_received_packets_total 108 +# HELP sora_srtp_sent_bytes_total The total number of sent SRTP bytes. +# TYPE sora_srtp_sent_bytes_total counter +sora_srtp_sent_bytes_total 107 +# HELP sora_srtp_sent_packets_total The total number of sent SRPT packets. +# TYPE sora_srtp_sent_packets_total counter +sora_srtp_sent_packets_total 106 # HELP sora_stats_webhook_total The total number of stats webhook. # TYPE sora_stats_webhook_total counter sora_stats_webhook_total{state="failed"} 99 diff --git a/test/sora_erlang_vm_enabled.metrics b/test/sora_erlang_vm_enabled.metrics index 1a4101f..4687289 100644 --- a/test/sora_erlang_vm_enabled.metrics +++ b/test/sora_erlang_vm_enabled.metrics @@ -131,6 +131,24 @@ sora_session_total{state="destroyed"} 0 sora_session_webhook_total{state="failed"} 95 sora_session_webhook_total{state="ignored"} 102 sora_session_webhook_total{state="successful"} 98 +# HELP sora_srtp_decrpyted_bytes_total The total number of decrypted SRTP bytes. +# TYPE sora_srtp_decrpyted_bytes_total counter +sora_srtp_decrpyted_bytes_total 105 +# HELP sora_srtp_decrypted_packets_total The total number of decrpyted SRTP packets. +# TYPE sora_srtp_decrypted_packets_total counter +sora_srtp_decrypted_packets_total 104 +# HELP sora_srtp_received_bytes_total The total number of received SRTP bytes. +# TYPE sora_srtp_received_bytes_total counter +sora_srtp_received_bytes_total 109 +# HELP sora_srtp_received_packets_total The total number of received SRTP packets. +# TYPE sora_srtp_received_packets_total counter +sora_srtp_received_packets_total 108 +# HELP sora_srtp_sent_bytes_total The total number of sent SRTP bytes. +# TYPE sora_srtp_sent_bytes_total counter +sora_srtp_sent_bytes_total 107 +# HELP sora_srtp_sent_packets_total The total number of sent SRPT packets. +# TYPE sora_srtp_sent_packets_total counter +sora_srtp_sent_packets_total 106 # HELP sora_stats_webhook_total The total number of stats webhook. # TYPE sora_stats_webhook_total counter sora_stats_webhook_total{state="failed"} 99 From 3110d2baea77a205e2b32fb17630e8c67fb70040 Mon Sep 17 00:00:00 2001 From: Takeshi NAMAO Date: Thu, 26 Sep 2024 12:44:55 +0900 Subject: [PATCH 5/8] =?UTF-8?q?SCTP=20=E3=81=AE=E3=83=A1=E3=83=88=E3=83=AA?= =?UTF-8?q?=E3=82=AF=E3=82=B9=E5=8F=8E=E9=9B=86=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- collector/collector.go | 4 ++++ collector/sctp.go | 33 +++++++++++++++++++++++++++++++++ collector/sora_api.go | 8 ++++++++ 3 files changed, 45 insertions(+) create mode 100644 collector/sctp.go diff --git a/collector/collector.go b/collector/collector.go index a40e75d..8939a7a 100644 --- a/collector/collector.go +++ b/collector/collector.go @@ -37,6 +37,7 @@ type Collector struct { ConnectionMetrics WebhookMetrics SrtpMetrics + SctpMetrics ClientMetrics SoraConnectionErrorMetrics ErlangVMMetrics @@ -87,6 +88,7 @@ func NewCollector(options *CollectorOptions) *Collector { ConnectionMetrics: connectionMetrics, WebhookMetrics: webhookMetrics, SrtpMetrics: srtpMetrics, + SctpMetrics: sctpMetrics, ClientMetrics: clientMetrics, SoraConnectionErrorMetrics: soraConnectionErrorMetrics, ErlangVMMetrics: erlangVMMetrics, @@ -203,6 +205,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) { c.ConnectionMetrics.Collect(ch, report.soraConnectionReport) c.WebhookMetrics.Collect(ch, report.soraWebhookReport) c.SrtpMetrics.Collect(ch, report.soraSrtpReport) + c.SctpMetrics.Collect(ch, report.soraSctpReport) if c.enableSoraClientMetrics { c.ClientMetrics.Collect(ch, report.SoraClientReport) @@ -226,6 +229,7 @@ func (c *Collector) Describe(ch chan<- *prometheus.Desc) { c.ConnectionMetrics.Describe(ch) c.WebhookMetrics.Describe(ch) c.SrtpMetrics.Describe(ch) + c.SctpMetrics.Describe(ch) if c.enableSoraClientMetrics { c.ClientMetrics.Describe(ch) diff --git a/collector/sctp.go b/collector/sctp.go new file mode 100644 index 0000000..df634a8 --- /dev/null +++ b/collector/sctp.go @@ -0,0 +1,33 @@ +package collector + +import "github.com/prometheus/client_golang/prometheus" + +var ( + sctpMetrics = SctpMetrics{ + totalReceivedSctp: newDesc("sctp_received_packets_total", "The total number of received SCTP packets."), + totalReceivedSctpByteSize: newDesc("sctp_received_bytes_total", "The total number of received SCTP bytes."), + totalSentSctp: newDesc("sctp_sent_packets_total", "The total number of sent SRPT packets."), + totalSentSctpByteSize: newDesc("sctp_sent_bytes_total", "The total number of sent SCTP bytes."), + } +) + +type SctpMetrics struct { + totalReceivedSctp *prometheus.Desc + totalReceivedSctpByteSize *prometheus.Desc + totalSentSctp *prometheus.Desc + totalSentSctpByteSize *prometheus.Desc +} + +func (m *SctpMetrics) Describe(ch chan<- *prometheus.Desc) { + ch <- m.totalReceivedSctp + ch <- m.totalReceivedSctpByteSize + ch <- m.totalSentSctp + ch <- m.totalSentSctpByteSize +} + +func (m *SctpMetrics) Collect(ch chan<- prometheus.Metric, report soraSctpReport) { + ch <- newCounter(m.totalReceivedSctp, float64(report.TotalReceivedSctp)) + ch <- newCounter(m.totalReceivedSctpByteSize, float64(report.TotalReceivedSctpByteSize)) + ch <- newCounter(m.totalSentSctp, float64(report.TotalSentSctp)) + ch <- newCounter(m.totalSentSctpByteSize, float64(report.TotalSentSctpByteSize)) +} diff --git a/collector/sora_api.go b/collector/sora_api.go index 4654622..67031d4 100644 --- a/collector/sora_api.go +++ b/collector/sora_api.go @@ -5,6 +5,7 @@ type soraGetStatsReport struct { soraConnectionReport soraWebhookReport soraSrtpReport + soraSctpReport SoraClientReport soraClientReport `json:"sora_client,omitempty"` SoraConnectionErrorReport soraConnectionErrorReport `json:"error,omitempty"` ErlangVMReport erlangVMReport `json:"erlang_vm,omitempty"` @@ -54,6 +55,13 @@ type soraSrtpReport struct { TotalDecryptedSrtpByteSize int64 `json:"total_decrypted_srtp_byte_size"` } +type soraSctpReport struct { + TotalReceivedSctp int64 `json:"total_received_sctp"` + TotalReceivedSctpByteSize int64 `json:"total_received_sctp_byte_size"` + TotalSentSctp int64 `json:"total_sent_sctp"` + TotalSentSctpByteSize int64 `json:"total_sent_sctp_byte_size"` +} + type soraClientStatistics struct { SoraAndroidSdk int64 `json:"sora_android_sdk"` SoraCSdk int64 `json:"sora_c_sdk"` From 70dcd27c2f5a5bf83191b4b1bf5d0536bd1c082a Mon Sep 17 00:00:00 2001 From: Takeshi NAMAO Date: Thu, 26 Sep 2024 12:45:05 +0900 Subject: [PATCH 6/8] =?UTF-8?q?SCTP=20=E3=83=A1=E3=83=88=E3=83=AA=E3=82=AF?= =?UTF-8?q?=E3=82=B9=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main_test.go | 8 ++++++++ test/maximum.metrics | 12 ++++++++++++ test/minimum.metrics | 12 ++++++++++++ test/sora_client_enabled.metrics | 12 ++++++++++++ test/sora_cluster_metrics_enabled.metrics | 12 ++++++++++++ test/sora_connection_error_enabled.metrics | 12 ++++++++++++ test/sora_erlang_vm_enabled.metrics | 12 ++++++++++++ 7 files changed, 80 insertions(+) diff --git a/main_test.go b/main_test.go index 4e9187b..34dcb9c 100644 --- a/main_test.go +++ b/main_test.go @@ -162,6 +162,8 @@ var ( "total_ignored_stats_webhook": 103, "total_ongoing_connections": 0, "total_received_invalid_turn_tcp_packet": 0, + "total_sent_sctp": 110, + "total_sent_sctp_byte_size": 111, "total_sent_srtp": 106, "total_sent_srtp_byte_size": 107, "total_session_created": 1, @@ -171,6 +173,8 @@ var ( "total_successful_event_webhook": 97, "total_successful_session_webhook": 98, "total_successful_stats_webhook": 100, + "total_received_sctp": 112, + "total_received_sctp_byte_size": 113, "total_received_srtp": 108, "total_received_srtp_byte_size": 109, "total_turn_tcp_connections": 2, @@ -427,6 +431,8 @@ func TestMinimumMetrics(t *testing.T) { "total_ignored_stats_webhook": 103, "total_ongoing_connections": 88, "total_received_invalid_turn_tcp_packet": 123, + "total_sent_sctp": 110, + "total_sent_sctp_byte_size": 111, "total_sent_srtp": 106, "total_sent_srtp_byte_size": 107, "total_session_created": 111, @@ -436,6 +442,8 @@ func TestMinimumMetrics(t *testing.T) { "total_successful_event_webhook": 97, "total_successful_session_webhook": 98, "total_successful_stats_webhook": 100, + "total_received_sctp": 112, + "total_received_sctp_byte_size": 113, "total_received_srtp": 108, "total_received_srtp_byte_size": 109, "total_turn_tcp_connections": 444, diff --git a/test/maximum.metrics b/test/maximum.metrics index 8ef8899..4a31288 100644 --- a/test/maximum.metrics +++ b/test/maximum.metrics @@ -188,6 +188,18 @@ sora_received_invalid_turn_tcp_packet_total 0 # TYPE sora_session_total counter sora_session_total{state="created"} 1 sora_session_total{state="destroyed"} 0 +# HELP sora_sctp_received_bytes_total The total number of received SCTP bytes. +# TYPE sora_sctp_received_bytes_total counter +sora_sctp_received_bytes_total 113 +# HELP sora_sctp_received_packets_total The total number of received SCTP packets. +# TYPE sora_sctp_received_packets_total counter +sora_sctp_received_packets_total 112 +# HELP sora_sctp_sent_bytes_total The total number of sent SCTP bytes. +# TYPE sora_sctp_sent_bytes_total counter +sora_sctp_sent_bytes_total 111 +# HELP sora_sctp_sent_packets_total The total number of sent SRPT packets. +# TYPE sora_sctp_sent_packets_total counter +sora_sctp_sent_packets_total 110 # HELP sora_session_webhook_total The total number of session webhook. # TYPE sora_session_webhook_total counter sora_session_webhook_total{state="failed"} 95 diff --git a/test/minimum.metrics b/test/minimum.metrics index 324193b..211b607 100644 --- a/test/minimum.metrics +++ b/test/minimum.metrics @@ -42,6 +42,18 @@ sora_received_invalid_turn_tcp_packet_total 123 # TYPE sora_session_total counter sora_session_total{state="created"} 111 sora_session_total{state="destroyed"} 222 +# HELP sora_sctp_received_bytes_total The total number of received SCTP bytes. +# TYPE sora_sctp_received_bytes_total counter +sora_sctp_received_bytes_total 113 +# HELP sora_sctp_received_packets_total The total number of received SCTP packets. +# TYPE sora_sctp_received_packets_total counter +sora_sctp_received_packets_total 112 +# HELP sora_sctp_sent_bytes_total The total number of sent SCTP bytes. +# TYPE sora_sctp_sent_bytes_total counter +sora_sctp_sent_bytes_total 111 +# HELP sora_sctp_sent_packets_total The total number of sent SRPT packets. +# TYPE sora_sctp_sent_packets_total counter +sora_sctp_sent_packets_total 110 # HELP sora_session_webhook_total The total number of session webhook. # TYPE sora_session_webhook_total counter sora_session_webhook_total{state="failed"} 95 diff --git a/test/sora_client_enabled.metrics b/test/sora_client_enabled.metrics index 94beff1..915d67a 100644 --- a/test/sora_client_enabled.metrics +++ b/test/sora_client_enabled.metrics @@ -73,6 +73,18 @@ sora_received_invalid_turn_tcp_packet_total 0 # TYPE sora_session_total counter sora_session_total{state="created"} 1 sora_session_total{state="destroyed"} 0 +# HELP sora_sctp_received_bytes_total The total number of received SCTP bytes. +# TYPE sora_sctp_received_bytes_total counter +sora_sctp_received_bytes_total 113 +# HELP sora_sctp_received_packets_total The total number of received SCTP packets. +# TYPE sora_sctp_received_packets_total counter +sora_sctp_received_packets_total 112 +# HELP sora_sctp_sent_bytes_total The total number of sent SCTP bytes. +# TYPE sora_sctp_sent_bytes_total counter +sora_sctp_sent_bytes_total 111 +# HELP sora_sctp_sent_packets_total The total number of sent SRPT packets. +# TYPE sora_sctp_sent_packets_total counter +sora_sctp_sent_packets_total 110 # HELP sora_session_webhook_total The total number of session webhook. # TYPE sora_session_webhook_total counter sora_session_webhook_total{state="failed"} 95 diff --git a/test/sora_cluster_metrics_enabled.metrics b/test/sora_cluster_metrics_enabled.metrics index 3b29678..e2fbdf3 100644 --- a/test/sora_cluster_metrics_enabled.metrics +++ b/test/sora_cluster_metrics_enabled.metrics @@ -75,6 +75,18 @@ sora_received_invalid_turn_tcp_packet_total 0 # TYPE sora_session_total counter sora_session_total{state="created"} 1 sora_session_total{state="destroyed"} 0 +# HELP sora_sctp_received_bytes_total The total number of received SCTP bytes. +# TYPE sora_sctp_received_bytes_total counter +sora_sctp_received_bytes_total 113 +# HELP sora_sctp_received_packets_total The total number of received SCTP packets. +# TYPE sora_sctp_received_packets_total counter +sora_sctp_received_packets_total 112 +# HELP sora_sctp_sent_bytes_total The total number of sent SCTP bytes. +# TYPE sora_sctp_sent_bytes_total counter +sora_sctp_sent_bytes_total 111 +# HELP sora_sctp_sent_packets_total The total number of sent SRPT packets. +# TYPE sora_sctp_sent_packets_total counter +sora_sctp_sent_packets_total 110 # HELP sora_session_webhook_total The total number of session webhook. # TYPE sora_session_webhook_total counter sora_session_webhook_total{state="failed"} 95 diff --git a/test/sora_connection_error_enabled.metrics b/test/sora_connection_error_enabled.metrics index 87e7d08..9d7be53 100644 --- a/test/sora_connection_error_enabled.metrics +++ b/test/sora_connection_error_enabled.metrics @@ -49,6 +49,18 @@ sora_received_invalid_turn_tcp_packet_total 0 # TYPE sora_session_total counter sora_session_total{state="created"} 1 sora_session_total{state="destroyed"} 0 +# HELP sora_sctp_received_bytes_total The total number of received SCTP bytes. +# TYPE sora_sctp_received_bytes_total counter +sora_sctp_received_bytes_total 113 +# HELP sora_sctp_received_packets_total The total number of received SCTP packets. +# TYPE sora_sctp_received_packets_total counter +sora_sctp_received_packets_total 112 +# HELP sora_sctp_sent_bytes_total The total number of sent SCTP bytes. +# TYPE sora_sctp_sent_bytes_total counter +sora_sctp_sent_bytes_total 111 +# HELP sora_sctp_sent_packets_total The total number of sent SRPT packets. +# TYPE sora_sctp_sent_packets_total counter +sora_sctp_sent_packets_total 110 # HELP sora_session_webhook_total The total number of session webhook. # TYPE sora_session_webhook_total counter sora_session_webhook_total{state="failed"} 95 diff --git a/test/sora_erlang_vm_enabled.metrics b/test/sora_erlang_vm_enabled.metrics index 4687289..27e0136 100644 --- a/test/sora_erlang_vm_enabled.metrics +++ b/test/sora_erlang_vm_enabled.metrics @@ -126,6 +126,18 @@ sora_received_invalid_turn_tcp_packet_total 0 # TYPE sora_session_total counter sora_session_total{state="created"} 1 sora_session_total{state="destroyed"} 0 +# HELP sora_sctp_received_bytes_total The total number of received SCTP bytes. +# TYPE sora_sctp_received_bytes_total counter +sora_sctp_received_bytes_total 113 +# HELP sora_sctp_received_packets_total The total number of received SCTP packets. +# TYPE sora_sctp_received_packets_total counter +sora_sctp_received_packets_total 112 +# HELP sora_sctp_sent_bytes_total The total number of sent SCTP bytes. +# TYPE sora_sctp_sent_bytes_total counter +sora_sctp_sent_bytes_total 111 +# HELP sora_sctp_sent_packets_total The total number of sent SRPT packets. +# TYPE sora_sctp_sent_packets_total counter +sora_sctp_sent_packets_total 110 # HELP sora_session_webhook_total The total number of session webhook. # TYPE sora_session_webhook_total counter sora_session_webhook_total{state="failed"} 95 From 570557689d7622a74ed9a7ee31b82b9cfe129380 Mon Sep 17 00:00:00 2001 From: Takeshi NAMAO Date: Thu, 26 Sep 2024 14:52:40 +0900 Subject: [PATCH 7/8] fix typo --- collector/sctp.go | 2 +- collector/srtp.go | 2 +- test/maximum.metrics | 4 ++-- test/minimum.metrics | 4 ++-- test/sora_client_enabled.metrics | 4 ++-- test/sora_cluster_metrics_enabled.metrics | 4 ++-- test/sora_connection_error_enabled.metrics | 4 ++-- test/sora_erlang_vm_enabled.metrics | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/collector/sctp.go b/collector/sctp.go index df634a8..6a04a38 100644 --- a/collector/sctp.go +++ b/collector/sctp.go @@ -6,7 +6,7 @@ var ( sctpMetrics = SctpMetrics{ totalReceivedSctp: newDesc("sctp_received_packets_total", "The total number of received SCTP packets."), totalReceivedSctpByteSize: newDesc("sctp_received_bytes_total", "The total number of received SCTP bytes."), - totalSentSctp: newDesc("sctp_sent_packets_total", "The total number of sent SRPT packets."), + totalSentSctp: newDesc("sctp_sent_packets_total", "The total number of sent SCTP packets."), totalSentSctpByteSize: newDesc("sctp_sent_bytes_total", "The total number of sent SCTP bytes."), } ) diff --git a/collector/srtp.go b/collector/srtp.go index 36eaff6..dc500c6 100644 --- a/collector/srtp.go +++ b/collector/srtp.go @@ -6,7 +6,7 @@ var ( srtpMetrics = SrtpMetrics{ totalReceivedSrtp: newDesc("srtp_received_packets_total", "The total number of received SRTP packets."), totalReceivedSrtpByteSize: newDesc("srtp_received_bytes_total", "The total number of received SRTP bytes."), - totalSentSrtp: newDesc("srtp_sent_packets_total", "The total number of sent SRPT packets."), + totalSentSrtp: newDesc("srtp_sent_packets_total", "The total number of sent SRTP packets."), totalSentSrtpByteSize: newDesc("srtp_sent_bytes_total", "The total number of sent SRTP bytes."), totalDecryptedSrtp: newDesc("srtp_decrypted_packets_total", "The total number of decrpyted SRTP packets."), totalDecryptedSrtpByteSize: newDesc("srtp_decrpyted_bytes_total", "The total number of decrypted SRTP bytes."), diff --git a/test/maximum.metrics b/test/maximum.metrics index 4a31288..9dc08c0 100644 --- a/test/maximum.metrics +++ b/test/maximum.metrics @@ -197,7 +197,7 @@ sora_sctp_received_packets_total 112 # HELP sora_sctp_sent_bytes_total The total number of sent SCTP bytes. # TYPE sora_sctp_sent_bytes_total counter sora_sctp_sent_bytes_total 111 -# HELP sora_sctp_sent_packets_total The total number of sent SRPT packets. +# HELP sora_sctp_sent_packets_total The total number of sent SCTP packets. # TYPE sora_sctp_sent_packets_total counter sora_sctp_sent_packets_total 110 # HELP sora_session_webhook_total The total number of session webhook. @@ -220,7 +220,7 @@ sora_srtp_received_packets_total 108 # HELP sora_srtp_sent_bytes_total The total number of sent SRTP bytes. # TYPE sora_srtp_sent_bytes_total counter sora_srtp_sent_bytes_total 107 -# HELP sora_srtp_sent_packets_total The total number of sent SRPT packets. +# HELP sora_srtp_sent_packets_total The total number of sent SRTP packets. # TYPE sora_srtp_sent_packets_total counter sora_srtp_sent_packets_total 106 # HELP sora_stats_webhook_total The total number of stats webhook. diff --git a/test/minimum.metrics b/test/minimum.metrics index 211b607..47ed127 100644 --- a/test/minimum.metrics +++ b/test/minimum.metrics @@ -51,7 +51,7 @@ sora_sctp_received_packets_total 112 # HELP sora_sctp_sent_bytes_total The total number of sent SCTP bytes. # TYPE sora_sctp_sent_bytes_total counter sora_sctp_sent_bytes_total 111 -# HELP sora_sctp_sent_packets_total The total number of sent SRPT packets. +# HELP sora_sctp_sent_packets_total The total number of sent SCTP packets. # TYPE sora_sctp_sent_packets_total counter sora_sctp_sent_packets_total 110 # HELP sora_session_webhook_total The total number of session webhook. @@ -74,7 +74,7 @@ sora_srtp_received_packets_total 108 # HELP sora_srtp_sent_bytes_total The total number of sent SRTP bytes. # TYPE sora_srtp_sent_bytes_total counter sora_srtp_sent_bytes_total 107 -# HELP sora_srtp_sent_packets_total The total number of sent SRPT packets. +# HELP sora_srtp_sent_packets_total The total number of sent SRTP packets. # TYPE sora_srtp_sent_packets_total counter sora_srtp_sent_packets_total 106 # HELP sora_stats_webhook_total The total number of stats webhook. diff --git a/test/sora_client_enabled.metrics b/test/sora_client_enabled.metrics index 915d67a..ccb12bb 100644 --- a/test/sora_client_enabled.metrics +++ b/test/sora_client_enabled.metrics @@ -82,7 +82,7 @@ sora_sctp_received_packets_total 112 # HELP sora_sctp_sent_bytes_total The total number of sent SCTP bytes. # TYPE sora_sctp_sent_bytes_total counter sora_sctp_sent_bytes_total 111 -# HELP sora_sctp_sent_packets_total The total number of sent SRPT packets. +# HELP sora_sctp_sent_packets_total The total number of sent SCTP packets. # TYPE sora_sctp_sent_packets_total counter sora_sctp_sent_packets_total 110 # HELP sora_session_webhook_total The total number of session webhook. @@ -105,7 +105,7 @@ sora_srtp_received_packets_total 108 # HELP sora_srtp_sent_bytes_total The total number of sent SRTP bytes. # TYPE sora_srtp_sent_bytes_total counter sora_srtp_sent_bytes_total 107 -# HELP sora_srtp_sent_packets_total The total number of sent SRPT packets. +# HELP sora_srtp_sent_packets_total The total number of sent SRTP packets. # TYPE sora_srtp_sent_packets_total counter sora_srtp_sent_packets_total 106 # HELP sora_stats_webhook_total The total number of stats webhook. diff --git a/test/sora_cluster_metrics_enabled.metrics b/test/sora_cluster_metrics_enabled.metrics index e2fbdf3..fa234ba 100644 --- a/test/sora_cluster_metrics_enabled.metrics +++ b/test/sora_cluster_metrics_enabled.metrics @@ -84,7 +84,7 @@ sora_sctp_received_packets_total 112 # HELP sora_sctp_sent_bytes_total The total number of sent SCTP bytes. # TYPE sora_sctp_sent_bytes_total counter sora_sctp_sent_bytes_total 111 -# HELP sora_sctp_sent_packets_total The total number of sent SRPT packets. +# HELP sora_sctp_sent_packets_total The total number of sent SCTP packets. # TYPE sora_sctp_sent_packets_total counter sora_sctp_sent_packets_total 110 # HELP sora_session_webhook_total The total number of session webhook. @@ -107,7 +107,7 @@ sora_srtp_received_packets_total 108 # HELP sora_srtp_sent_bytes_total The total number of sent SRTP bytes. # TYPE sora_srtp_sent_bytes_total counter sora_srtp_sent_bytes_total 107 -# HELP sora_srtp_sent_packets_total The total number of sent SRPT packets. +# HELP sora_srtp_sent_packets_total The total number of sent SRTP packets. # TYPE sora_srtp_sent_packets_total counter sora_srtp_sent_packets_total 106 # HELP sora_stats_webhook_total The total number of stats webhook. diff --git a/test/sora_connection_error_enabled.metrics b/test/sora_connection_error_enabled.metrics index 9d7be53..a9a7eef 100644 --- a/test/sora_connection_error_enabled.metrics +++ b/test/sora_connection_error_enabled.metrics @@ -58,7 +58,7 @@ sora_sctp_received_packets_total 112 # HELP sora_sctp_sent_bytes_total The total number of sent SCTP bytes. # TYPE sora_sctp_sent_bytes_total counter sora_sctp_sent_bytes_total 111 -# HELP sora_sctp_sent_packets_total The total number of sent SRPT packets. +# HELP sora_sctp_sent_packets_total The total number of sent SCTP packets. # TYPE sora_sctp_sent_packets_total counter sora_sctp_sent_packets_total 110 # HELP sora_session_webhook_total The total number of session webhook. @@ -81,7 +81,7 @@ sora_srtp_received_packets_total 108 # HELP sora_srtp_sent_bytes_total The total number of sent SRTP bytes. # TYPE sora_srtp_sent_bytes_total counter sora_srtp_sent_bytes_total 107 -# HELP sora_srtp_sent_packets_total The total number of sent SRPT packets. +# HELP sora_srtp_sent_packets_total The total number of sent SRTP packets. # TYPE sora_srtp_sent_packets_total counter sora_srtp_sent_packets_total 106 # HELP sora_stats_webhook_total The total number of stats webhook. diff --git a/test/sora_erlang_vm_enabled.metrics b/test/sora_erlang_vm_enabled.metrics index 27e0136..d5e3a1b 100644 --- a/test/sora_erlang_vm_enabled.metrics +++ b/test/sora_erlang_vm_enabled.metrics @@ -135,7 +135,7 @@ sora_sctp_received_packets_total 112 # HELP sora_sctp_sent_bytes_total The total number of sent SCTP bytes. # TYPE sora_sctp_sent_bytes_total counter sora_sctp_sent_bytes_total 111 -# HELP sora_sctp_sent_packets_total The total number of sent SRPT packets. +# HELP sora_sctp_sent_packets_total The total number of sent SCTP packets. # TYPE sora_sctp_sent_packets_total counter sora_sctp_sent_packets_total 110 # HELP sora_session_webhook_total The total number of session webhook. @@ -158,7 +158,7 @@ sora_srtp_received_packets_total 108 # HELP sora_srtp_sent_bytes_total The total number of sent SRTP bytes. # TYPE sora_srtp_sent_bytes_total counter sora_srtp_sent_bytes_total 107 -# HELP sora_srtp_sent_packets_total The total number of sent SRPT packets. +# HELP sora_srtp_sent_packets_total The total number of sent SRTP packets. # TYPE sora_srtp_sent_packets_total counter sora_srtp_sent_packets_total 106 # HELP sora_stats_webhook_total The total number of stats webhook. From c4f81a3a0834570b75f63a06123e0ca8ade5b7ff Mon Sep 17 00:00:00 2001 From: Takeshi NAMAO Date: Thu, 26 Sep 2024 15:11:31 +0900 Subject: [PATCH 8/8] =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=B1=A5=E6=AD=B4?= =?UTF-8?q?=E3=81=AB=E8=BF=BD=E8=A8=98=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 1454809..b47f9d2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,29 @@ ## develop +- [ADD] SRTP 統計情報を追加する + - Sora API の GetStatsReport API から取得可能な SRTP 統計情報を以下のメトリクス名で追加する + - `sora_srtp_received_packets_total` + - `sora_srtp_received_bytes_total` + - `sora_srtp_sent_packets_total` + - `sora_srtp_sent_bytes_total` + - `sora_srtp_decrypted_packets_total` + - `sora_srtp_decrypted_bytes_total` + - @tnamao +- [ADD] SCTP 統計情報を追加する + - Sora API の GetStatsReport API から取得可能な SCTP 統計情報を以下のメトリクス名で追加する + - `sora_sctp_received_packets_total` + - `sora_sctp_received_bytes_total` + - `sora_sctp_sent_packets_total` + - `sora_sctp_sent_bytes_total` + - @tnamao +- [ADD] 無視されたウェブフック数の統計情報を追加する + - Sora API の GetStatsReport API から取得可能な無視されたウェブフック数を以下のメトリクス名で追加する + - 既存の以下のメトリクスの `state` ラベルに `ignored` で値を返す + - `sora_event_webhook_total` + - `sora_session_webhook_total` + - `sora_stats_webhook_total` + - @tnamao - [CHANGE] ログライブラリの変更 - `prometheus/exporter-toolkit` の依存ログライブラリが `go-kit/log` から Go 言語標準ライブラリの `log/slog` に変更されたため、Sora expoter 内で使用しているロガーも `log/slog` に切り替える - 同様にテストコードで使用していた `NewNopLogger` は代替として `slog.New(slog.NewTextHandler(io.Discard, nil))` を使用する形に変更する