Azure / Azure/data-api-builder
[Bug]: Critical! Health check response-ms includes full HTTP roundtrip, not just query time
- Vorherrschende Sprache
- C#
- Sterne
- 1.5k
- Forks
- 370
- Ø Merge
- 3 T. 22 Std.
- Gemergte PRs (30 T.)
- 9
Beschreibung
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+.
Beitragsleitfaden
Rechercherichtung
Beginne damit, HealthCheckHelper zu finden und nachzuverfolgen, wie es die Aufrufe GET /api/{entity}?$first=N und POST /graphql zeitlich erfasst. Vergleiche die gemeldete response-ms mit der Verarbeitungszeit der Datenbank oder des Endpunkts; die Aufgabe ist abgeschlossen, wenn die Metrik die vollständige HTTP- und Middleware-Rundreise ausschließt und durch geeignete Tests abgedeckt ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp, graphql, sql
- Bereich
- api, databases, observability
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 45/100