Skip to content

Refactor Grafana dashboard: update metrics titles, adjust grid positions, and enhance error ratio calculation#1458

Merged
TinyKitten merged 2 commits into
devfrom
feature/improve-grafana
Mar 24, 2026
Merged

Refactor Grafana dashboard: update metrics titles, adjust grid positions, and enhance error ratio calculation#1458
TinyKitten merged 2 commits into
devfrom
feature/improve-grafana

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Mar 24, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

リリースノート

  • 新機能

    • Method別・Status別のリクエスト数を表示する新しいパネルを追加
  • 改善

    • エラー率パネルを「Status内訳(毎秒)」に更新し詳細なステータス表示に改善
    • 遅延メトリクスの表示単位を秒からミリ秒へ変更し平均表示を調整
    • パネル名を「平均Duration(Method別)」にリネーム
    • エラー率ゲージを「現在のエラー率」として計算ロジックを改善
    • ダッシュボードのレイアウトと凡例/ツールチップ表示を最適化

@TinyKitten TinyKitten self-assigned this Mar 24, 2026
@github-actions github-actions Bot added the feature 要望対応や課題解決 label Mar 24, 2026
@coderabbitai

coderabbitai Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9efcc93f-0d4c-4e84-9635-7dcd3594a9a9

📥 Commits

Reviewing files that changed from the base of the PR and between ade651c and ddf00af.

📒 Files selected for processing (1)
  • docker/grafana/dashboards/stationapi-grpc.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • docker/grafana/dashboards/stationapi-grpc.json

📝 Walkthrough

Walkthrough

Grafana ダッシュボード JSON を更新し、複数パネルの PromQL と表示単位をミリ秒へ変更、エラー比率の式を修正、レイアウト(gridPos)調整と新しい「Requests by Method and Status」パネルを追加。

Changes

Cohort / File(s) Summary
Grafana ダッシュボード設定
docker/grafana/dashboards/stationapi-grpc.json
「Error Rate (per second)」をステータス別の「Status Breakdown (per second)」へ変更(PromQL を sum(...) by (status) に), レイテンシパネルを秒からミリ秒へ変更しクエリを *1000 でスケーリング、Request Duration per MethodAverage Duration per Method に変更して集約式を更新、Error RatioCurrent Error Ratio に改名して PromQL を status!="ok" / clamp_min(total, 1e-9) に変更、新規パネル Requests by Method and Status を追加(sum(rate(grpc_requests_total[5m])) by (method,status))、複数パネルの gridPos を調整、legend と tooltip を正規化、末尾改行削除。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 新しいダッシュボードで跳ねるよ、
ステータス別がくっきり見える、
ミリ秒で刻むリズム軽やかに、
エラーの比率はそっと守る、
メトリクス畑に春が来た ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed プルリクエストのタイトルは、Grafanaダッシュボードの複数の主要な変更(メトリクスタイトルの更新、グリッド位置の調整、エラー率計算の改善)を正確に要約しており、変更セットの主要な内容と十分に関連している。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/improve-grafana

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docker/grafana/dashboards/stationapi-grpc.json`:
- Line 234: The panel is configured with unit: "ms" but its query
grpc_request_duration_seconds_sum / grpc_request_duration_seconds_count returns
seconds; update the query used in the Average Duration panels (the expression
using grpc_request_duration_seconds_sum and grpc_request_duration_seconds_count)
to convert seconds to milliseconds by multiplying the result by 1000 (e.g.
(grpc_request_duration_seconds_sum / grpc_request_duration_seconds_count) *
1000), and keep the unit: "ms" so the displayed values match the unit; apply the
same change to the other affected panel(s) referenced by the same query.
- Line 85: 表示単位がミリ秒になっていますが、クエリ(histogram_quantile を使っている
grpc_request_duration_seconds_bucket
から計算)が秒単位を返すため表示が不正確です。対応策としては、ダッシュボードの該当パネルで unit を "s"
に戻すか、クエリ(histogram_quantile(...) on
grpc_request_duration_seconds_bucket)側で結果を1000倍して ms に変換するどちらかを採用してください;パネル定義の
unit フィールドと該当クエリ(histogram_quantile /
grpc_request_duration_seconds_bucket)を修正してください。

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d2e43b50-daeb-4482-8d0d-28f10503a765

📥 Commits

Reviewing files that changed from the base of the PR and between 894a834 and ade651c.

📒 Files selected for processing (1)
  • docker/grafana/dashboards/stationapi-grpc.json

Comment thread docker/grafana/dashboards/stationapi-grpc.json
Comment thread docker/grafana/dashboards/stationapi-grpc.json
…seconds

Latency queries return seconds but panels display as ms. Multiply query
results by 1000 to match the configured unit in Request Latency and
Average Duration panels.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@TinyKitten TinyKitten merged commit cead19d into dev Mar 24, 2026
3 checks passed
@TinyKitten TinyKitten deleted the feature/improve-grafana branch March 24, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature 要望対応や課題解決

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant