Metrics: Add http_response_size_bytes metric (#110428)

* Metrics: Add http_response_size_bytes metric

* add better handler names for public asset paths

* fix tests

* comment

* remove debug log

* exemplar
This commit is contained in:
Josh Hunt
2025-09-03 14:47:38 +01:00
committed by GitHub
parent 4e28cba1c5
commit bda895ec03
3 changed files with 44 additions and 17 deletions
@@ -143,8 +143,8 @@ func TestFrontendService_Middleware(t *testing.T) {
metricsBody := recorder.Body.String()
assert.Contains(t, metricsBody, "# TYPE grafana_http_request_duration_seconds histogram")
assert.Contains(t, metricsBody, "grafana_http_request_duration_seconds_bucket{handler=\"public-assets\"") // assets 404
assert.Contains(t, metricsBody, "grafana_http_request_duration_seconds_bucket{handler=\"/*\"") // index route
assert.Contains(t, metricsBody, "grafana_http_request_duration_seconds_bucket{handler=\"public-build-assets\"") // assets 404
assert.Contains(t, metricsBody, "grafana_http_request_duration_seconds_bucket{handler=\"/*\"") // index route
})
t.Run("should add context middleware", func(t *testing.T) {