diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b77012e..41cd3a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: name: static-check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 190ff31..10354e8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,10 +11,10 @@ jobs: name: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version-file: "./go.mod" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 19cecdc..19a4ded 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: name: go test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v4 diff --git a/CHANGES.md b/CHANGES.md index 802a079..0eb5139 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,12 @@ # CHANGES +## 2023.4.0 + +- [ADD] `sora_client` の `sora_python_sdk` に対応する + - @tnamao +- [UPDATE] Go を 1.21 に上げる + - @tnamao + ## 2023.3.0 - [ADD] `sora_client` の `obs_studio_whip` に対応する @@ -8,6 +15,7 @@ - `prometheus/client-golang` 1.14.0 => 1.16.0 - `prometheus/common` 0.41.0 => 0.44.0 - `prometheus/exporter-toolkit` 0.9.1 => 0.10.0 + - @tnamao ## 2023.2.0 diff --git a/collector/client.go b/collector/client.go index 2731584..ab2bc28 100644 --- a/collector/client.go +++ b/collector/client.go @@ -25,6 +25,7 @@ func (m *ClientMetrics) Collect(ch chan<- prometheus.Metric, report soraClientRe ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalFailedSoraClientType.SoraJsSdk), "js_sdk", "failed") ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalFailedSoraClientType.SoraUnitySdk), "unity_sdk", "failed") ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalFailedSoraClientType.ObsStudioWhip), "obs_studio_whip", "failed") + ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalFailedSoraClientType.SoraPythonSdk), "python_sdk", "failed") ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalFailedSoraClientType.Unknown), "unknown", "failed") ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalFailedSoraClientType.WebrtcLoadTestingToolZakuro), "zakuro", "failed") ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalFailedSoraClientType.WebrtcNativeClientMomo), "momo", "failed") @@ -35,6 +36,7 @@ func (m *ClientMetrics) Collect(ch chan<- prometheus.Metric, report soraClientRe ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalSuccessfulSoraClientType.SoraJsSdk), "js_sdk", "successful") ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalSuccessfulSoraClientType.SoraUnitySdk), "unity_sdk", "successful") ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalSuccessfulSoraClientType.ObsStudioWhip), "obs_studio_whip", "successful") + ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalSuccessfulSoraClientType.SoraPythonSdk), "python_sdk", "successful") ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalSuccessfulSoraClientType.Unknown), "unknown", "successful") ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalSuccessfulSoraClientType.WebrtcLoadTestingToolZakuro), "zakuro", "successful") ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalSuccessfulSoraClientType.WebrtcNativeClientMomo), "momo", "successful") diff --git a/collector/sora_api.go b/collector/sora_api.go index 90adeba..08fd930 100644 --- a/collector/sora_api.go +++ b/collector/sora_api.go @@ -46,6 +46,7 @@ type soraClientStatistics struct { SoraJsSdk int64 `json:"sora_js_sdk"` SoraUnitySdk int64 `json:"sora_unity_sdk"` ObsStudioWhip int64 `json:"obs_studio_whip"` + SoraPythonSdk int64 `json:"sora_python_sdk"` Unknown int64 `json:"unknown"` WebrtcLoadTestingToolZakuro int64 `json:"webrtc_load_testing_tool_zakuro"` WebrtcNativeClientMomo int64 `json:"webrtc_native_client_momo"` diff --git a/go.mod b/go.mod index be87016..52e0f95 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/shiguredo/sora_exporter -go 1.20 +go 1.21 require ( github.com/alecthomas/kingpin/v2 v2.3.2 diff --git a/go.sum b/go.sum index cce5dda..6111ac4 100644 --- a/go.sum +++ b/go.sum @@ -24,9 +24,11 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= @@ -46,9 +48,11 @@ github.com/prometheus/exporter-toolkit v0.10.0/go.mod h1:+sVFzuvV5JDyw+Ih6p3zFxZ github.com/prometheus/procfs v0.11.0 h1:5EAgkfkMl659uZPbe9AS2N68a7Cc1TJbPEuGzFuRbyk= github.com/prometheus/procfs v0.11.0/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc= github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -79,7 +83,9 @@ google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/main_test.go b/main_test.go index ae94a17..50f4a72 100644 --- a/main_test.go +++ b/main_test.go @@ -104,6 +104,7 @@ var ( "sora_js_sdk": 3, "sora_unity_sdk": 4, "obs_studio_whip": 10, + "sora_python_sdk": 11, "unknown": 5, "webrtc_load_testing_tool_zakuro": 8, "webrtc_native_client_momo": 6 @@ -116,6 +117,7 @@ var ( "sora_js_sdk": 33, "sora_unity_sdk": 44, "obs_studio_whip": 1010, + "sora_python_sdk": 1111, "unknown": 55, "webrtc_load_testing_tool_zakuro": 88, "webrtc_native_client_momo": 66 diff --git a/test/maximum.metrics b/test/maximum.metrics index b5a54de..7f2aafd 100644 --- a/test/maximum.metrics +++ b/test/maximum.metrics @@ -39,6 +39,8 @@ sora_client_type_total{client="unity_sdk",state="failed"} 4 sora_client_type_total{client="unity_sdk",state="successful"} 44 sora_client_type_total{client="obs_studio_whip",state="failed"} 10 sora_client_type_total{client="obs_studio_whip",state="successful"} 1010 +sora_client_type_total{client="python_sdk",state="failed"} 11 +sora_client_type_total{client="python_sdk",state="successful"} 1111 sora_client_type_total{client="unknown",state="failed"} 5 sora_client_type_total{client="unknown",state="successful"} 55 sora_client_type_total{client="zakuro",state="failed"} 8 diff --git a/test/sora_client_enabled.metrics b/test/sora_client_enabled.metrics index fe70879..5097d55 100644 --- a/test/sora_client_enabled.metrics +++ b/test/sora_client_enabled.metrics @@ -26,6 +26,8 @@ sora_client_type_total{client="unity_sdk",state="failed"} 4 sora_client_type_total{client="unity_sdk",state="successful"} 44 sora_client_type_total{client="obs_studio_whip",state="failed"} 10 sora_client_type_total{client="obs_studio_whip",state="successful"} 1010 +sora_client_type_total{client="python_sdk",state="failed"} 11 +sora_client_type_total{client="python_sdk",state="successful"} 1111 sora_client_type_total{client="unknown",state="failed"} 5 sora_client_type_total{client="unknown",state="successful"} 55 sora_client_type_total{client="zakuro",state="failed"} 8