Azure / Azure/data-api-builder

[Bug]: Critical! Health check response-ms includes full HTTP roundtrip, not just query time

オープン
#3,568 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
2.x health-endpoint
主要言語
C#
スター
1.5k
フォーク
370
平均マージ
3日 22時間
マージ済み PR(30日)
9

説明

The `response-ms` value in health check results measures the full self-HTTP-call duration (HTTP client → middleware → auth → routing → controller → DB → response), not just the database query execution time.

## Expected

`response-ms` should ideally represent the actual database query or endpoint processing time, making it useful for monitoring database health.

## Actual

The health check implementation (`HealthCheckHelper`) makes real HTTP calls to `GET /api/{entity}?$first=N` and `POST /graphql`. The `response-ms` measures the complete round-trip through:

1. HTTP client overhead
2. Kestrel request processing
3. Authentication middleware
4. Routing middleware
5. Controller action
6. SQL query execution
7. JSON serialization
8. Response delivery

Evidence from DAB logs:
```
Start processing HTTP request GET http://localhost:5000/api/Todo?$first=50
Sending HTTP request GET http://localhost:5000/api/Todo?$first=50
...
Received HTTP response headers after 155.4462ms - 200
```

A simple `SELECT TOP 51` query takes <5ms in the database, but the health check reports 155ms+ because it includes the full middleware pipeline. On cold starts (first health check after startup), this can be 500-700ms+.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず HealthCheckHelper の場所を特定し、GET /api/{entity}?$first=N と POST /graphql の呼び出しの時間をどのように計測しているかを追跡します。報告された response-ms をデータベースまたはエンドポイントの処理時間と比較します。完了条件は、メトリクスが HTTP と middleware のラウンドトリップ全体を除外し、適切なテストでカバーされていることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp, graphql, sql
領域
api, databases, observability
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。