mirror of
https://github.com/minio/minio.git
synced 2025-11-08 21:24:55 -05:00
Add TTFB to all APIs and enable for responses without body (#20479)
Add TTFB for all requests in metrics-v3 in addition to the existing GetObject. Also for the requests that do not return a body in the response, calculate TTFB as the HTTP status code and the headers are sent.
This commit is contained in:
committed by
Harshavardhana
parent
f6f0807c86
commit
2b0156b1fc
@@ -129,7 +129,7 @@ func loadAPIRequestsHTTPMetrics(ctx context.Context, m MetricValues, _ *metricsC
|
||||
// This is a `MetricsLoaderFn`.
|
||||
func loadAPIRequestsTTFBMetrics(ctx context.Context, m MetricValues, _ *metricsCache) error {
|
||||
renameLabels := map[string]string{"api": "name"}
|
||||
labelsFilter := map[string]set.StringSet{"api": set.CreateStringSet("GetObject")}
|
||||
labelsFilter := map[string]set.StringSet{}
|
||||
m.SetHistogram(apiRequestsTTFBSecondsDistribution, httpRequestsDuration, labelsFilter, renameLabels, nil,
|
||||
"type", "s3")
|
||||
return nil
|
||||
@@ -217,7 +217,7 @@ func loadBucketAPIHTTPMetrics(ctx context.Context, m MetricValues, _ *metricsCac
|
||||
// This is a `MetricsLoaderFn`.
|
||||
func loadBucketAPITTFBMetrics(ctx context.Context, m MetricValues, _ *metricsCache, buckets []string) error {
|
||||
renameLabels := map[string]string{"api": "name"}
|
||||
labelsFilter := map[string]set.StringSet{"api": set.CreateStringSet("GetObject")}
|
||||
labelsFilter := map[string]set.StringSet{}
|
||||
m.SetHistogram(apiRequestsTTFBSecondsDistribution, bucketHTTPRequestsDuration, labelsFilter, renameLabels,
|
||||
buckets, "type", "s3")
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user