Add common middleware to S3 API handlers (#19171)

The middleware sets up tracing, throttling, gzipped responses and
collecting API stats.

Additionally, this change updates the names of handler functions in
metric labels to be the same as the name derived from Go lang reflection
on the handler name.

The metric api labels are now stored in memory the same as the handler
name - they will be camelcased, e.g. `GetObject` instead of `getobject`.

For compatibility, we lowercase the metric api label values when emitting the metrics.
This commit is contained in:
Aditya Manthramurthy
2024-03-04 10:05:56 -08:00
committed by GitHub
parent d5656eeb65
commit 9a4d003ac7
12 changed files with 372 additions and 203 deletions

View File

@@ -159,7 +159,7 @@ var (
)
func (t *tierMetrics) Report() []Metric {
metrics := getHistogramMetrics(t.histogram, tierTTLBMD)
metrics := getHistogramMetrics(t.histogram, tierTTLBMD, true)
t.RLock()
defer t.RUnlock()
for tier, stat := range t.requestsCount {