Skip to content

shiguredo/kohaku

Repository files navigation

WebRTC Stats Collector Kohaku

GitHub tag (latest SemVer) License

About Shiguredo's open source software

We will not respond to PRs or issues that have not been discussed on Discord. Also, Discord is only available in Japanese.

Please read https://github.com/shiguredo/oss/blob/master/README.en.md before use.

時雨堂のオープンソースソフトウェアについて

利用前に https://github.com/shiguredo/oss をお読みください。

WebRTC Stats Collector Kohaku について

Kohaku はクライアントと Sora の統計情報を Sora から統計ウェブフックで受け取り、 ClickHouse に格納するゲートウェイです。

注意

  • Kohaku 2023.1.1 は 2023.2.x でも利用できます
  • 開発版は統計ウェブフック機能が追加された Sora 2024.1.0 から利用できます

特徴

  • Sora の統計ウェブフック機能で、統計情報を受け取り ClickHouse に格納します
  • WebRTC 統計 API に対応しています
    • ブラウザは最新 Chrome / Firefox / Safari / Edge へ対応
    • Sora SDK は iOS / Android / Unity / C++ / Python に対応
    • WebRTC Native Client Momo に対応
  • クライアントは Sora に統計情報を送るだけでよくなるため、どこかのサーバに対して接続などが不要になります
  • すべての統計情報を Sora の Channel ID と Connection ID と関連付けて保存するため問題の追跡がしやすくなります
  • Grafana ダッシュボードを用意

Grafana ダッシュボード

すぐに使い始められるように Grafana ダッシュボードを作り込んであります。 接続一覧からコネクション ID をクリックすると受信した音声や映像(inbound-rtp)の統計情報が確認できます。

Image from Gyazo

Image from Gyazo

使ってみる

Kohaku を使ってみたい人は USE.md をお読みください。

シーケンス

sequenceDiagram
  participant C as クライアント
  participant S as Sora
  participant K as Kohaku
  participant T as ClickHouse
  participant G as Grafana
  note over K,T: DB 接続済み
  note over C,S: WebRTC 確立済み
  S->>+C: type: stats-req
  C->>-S: type: stats<br>WebRTC 統計情報
  S-)K: 統計ウェブフック over HTTP/1.1
  K->>T: INSERT TO ...
  G->>T: SELECT ...
  T->>G: 結果
  S->>+C: type: stats-req
  C->>-S: type: stats<br>WebRTC 統計情報
  S-)K: 統計ウェブフック over HTTP/1.1
  K->>T: INSERT TO ...
Loading

ライセンス

Apache License 2.0

Copyright 2021-2024, Hiroshi Yoshida (Original Author)
Copyright 2021-2024, Shiguredo Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

優先実装

優先実装とは Sora のライセンスを契約頂いているお客様限定で Kohaku の実装予定機能を有償にて前倒しで実装することです。

詳細は Discord やメールなどでお気軽にお問い合わせください

記事