Skip to content

session_webhook 追加によるダッシュボードの改善#4

Merged
Hexa merged 8 commits intodevelopfrom
feature/improve-dashboard
Jan 20, 2026
Merged

session_webhook 追加によるダッシュボードの改善#4
Hexa merged 8 commits intodevelopfrom
feature/improve-dashboard

Conversation

@Hexa
Copy link
Contributor

@Hexa Hexa commented Jan 19, 2026

This pull request adds support for ingesting and processing a new log type, session_webhook, throughout the logging and ingestion pipeline. The changes cover updates to log sources, output destinations, configuration for database columns, and the list of targets for ingestion.

Log ingestion and processing pipeline:

  • Added a new tail input in fluent-bit/fluent-bit.yml.rustfs to read session_webhook.jsonl logs, using the JSON parser, and storing state in session_webhook.db with the tag session_webhook.
  • Added an S3 output configuration in fluent-bit/fluent-bit.yml.rustfs for logs tagged session_webhook, mirroring the configuration used for rtc_stats.

Database and ingestion configuration:

  • Created a new column definition file ingester/DUCKDB_COLUMNS/session_webhook.yml specifying the schema for session_webhook logs with columns id, timestamp, and req.
  • Added session_webhook to the LOG_TARGETS list in ingester/src/run.py to enable ingestion of this log type.

@Hexa
Copy link
Contributor Author

Hexa commented Jan 19, 2026

!haiku レビューをお願いします

@github-actions
Copy link

github-actions bot commented Jan 19, 2026

Claude finished @Hexa's task in 50s —— View job


レビュー

タスク

  • CLAUDE.md を確認する
  • 変更ファイルを読み込む
  • 変更内容を分析する
  • レビュー結果を記載する

重要な指摘(優先度順)

1. PR タイトルと内容の不一致

PR タイトルは「ダッシュボードを改善する」ですが、PR の説明は「session_webhook ログ型の追加」について書かれています。さらに、実際の変更の大部分は Grafana ダッシュボード(+4518/-415 行)です。

問題: PR タイトル、説明、実装内容に一貫性がありません。タイトル、説明、内容を整えてください。


2. session_webhook.yml のスキーマ不完全

ingester/DUCKDB_COLUMNS/session_webhook.yml:3 では、スキーマが以下のように定義されています:

---
id: VARCHAR
timestamp: TIMESTAMPTZ
req: JSON

一方、Grafana ダッシュボードの SQL クエリでは以下のフィールドを req JSON から抽出しようとしています:

req->>'$.timestamp'
req->>'$.max_connections'
req->>'$.total_connections'
req->>'$.version'
req->>'$.node_name'
req->>'$.group_id'
req->>'$.spotlight'
req->>'$.connections'
req->>'$.session_id'

問題: スキーマ定義が req JSON フィールドの内容を明確にしていません。rtc_stats.yml のように具体的なカラムを定義するか、スキーマ定義文書を追加してください。


3. Grafana ダッシュボード ID の重複の可能性

grafana/dashboards/kohaku/rtc-stats.json:21 で ID が 2 から 3 に変更されています。

問題: 他の既存ダッシュボードが ID 3 を使用していないかを確認してください。ID 重複はダッシュボード読み込み時にエラーになります。


4. SQL クエリの問題

Grafana ダッシュボードの SQL クエリに以下の問題があります:

WHERE $__timeFilter(timestamp) AND (req->>'$.session_id') :: VARCHAR = $session_id
  • timestamp カラムと req->>'$.timestamp' の二重定義の可能性
  • $session_id 変数がダッシュボード上で定義されているか不明確
  • タイムフィルタの実装が正しいか確認が必要

問題: SQL クエリの検証と、必要な Grafana 変数の定義を確認してください。


5. fluent-bit 設定の一貫性

fluent-bit/fluent-bit.yml.rustfs:16-20fluent-bit/fluent-bit.yml.rustfs:31-37 の session_webhook 出力設定が rtc_stats と完全に同じです。これは正しいか確認が必要です。

問題: session_webhook と rtc_stats でログのフォーマットや処理が異なる場合、S3 出力設定が異なるべきです。意図的に同じである場合は、コメント追加で説明してください。


その他の指摘

  1. コミットメッセージの確認: PR の 8 つのコミットメッセージが日本語で命令形になっているか確認してください(CLAUDE.md の要件)。

  2. リリースノートとの整合性: CLAUDE.md に「変更点とリリースノートの整合性を確認すること」と記載されています。リリースノートが存在する場合は、この PR の変更が記載されているか確認してください。


修正方法

以下の順序で修正をお願いします:

  1. PR タイトルと説明を統一する(「dashboard improvements with session_webhook support」など)
  2. session_webhook.yml のスキーマを rtc_stats.yml に倣って具体的に定義する
  3. Grafana ダッシュボード ID の重複を確認する
  4. SQL クエリと Grafana 変数を検証する
  5. fluent-bit 設定が正しいか確認し、必要に応じてコメント追加

@Hexa Hexa changed the title ダッシュボードを改善する session_webhook 追加によるダッシュボードの改善 Jan 19, 2026
@Hexa
Copy link
Contributor Author

Hexa commented Jan 19, 2026

  1. PR タイトルと説明を統一する(「dashboard improvements with session_webhook support」など)

変更しました

  1. session_webhook.yml のスキーマを rtc_stats.yml に倣って具体的に定義する

現時点では、追加や削除しやすいように JSON 型でにしています

  1. Grafana ダッシュボード ID の重複を確認する

初期読み込みのため問題はありません

  1. SQL クエリと Grafana 変数を検証する
  • timestamp カラムと req->>'$.timestamp' の二重定義の可能性

$__timeFilter は timestamp、req 内の JSON オブジェクトの timestamp が必要な場合は req->>'$timestamp' で、それぞれ別であっています

  • $session_id 変数がダッシュボード上で定義されているか不明確

変数で定義されています

  • タイムフィルタの実装が正しいか確認が必要

Grafana の機能のためここでは確認しません

  1. fluent-bit 設定が正しいか確認し、必要に応じてコメント追加

アップロードしているだけであるため、意図的に同じです

@Hexa Hexa marked this pull request as ready for review January 20, 2026 02:28
@Hexa Hexa merged commit 868d353 into develop Jan 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant