Histogram metric of HTTP request duration ignroes Put requests #280

Closed
opened 2023-12-11 11:19:59 +00:00 by alexvanin · 0 comments
Owner

Found by @a.bogatyrev

Expected Behavior

frostfs_s3_gw_statistic_requests_seconds_bucket metric provide both Put and Get api labels.

Current Behavior

Metric calculates only Get api labels.

Possible Solution

Update HTTP Verb condition check in middleware.

if r.Method == http.MethodGet {
	// Increment the prometheus http request response histogram with appropriate label
	appMetrics.Statistic().RequestDurationsUpdate(reqInfo.API, durationSecs)
}

Steps to Reproduce (for bugs)

  1. Create bucket
  2. Upload an object
  3. Get an object
  4. Read metrics

Regression

No. It was introduced back in 2020 during initial development.

Your Environment

frostfs-aio v1.3.0

Found by @a.bogatyrev ## Expected Behavior `frostfs_s3_gw_statistic_requests_seconds_bucket` metric provide both Put and Get `api` labels. ## Current Behavior Metric calculates only Get `api` labels. ## Possible Solution Update HTTP Verb condition check in middleware. ```go if r.Method == http.MethodGet { // Increment the prometheus http request response histogram with appropriate label appMetrics.Statistic().RequestDurationsUpdate(reqInfo.API, durationSecs) } ``` ## Steps to Reproduce (for bugs) 1. Create bucket 2. Upload an object 3. Get an object 4. Read metrics ## Regression No. It was introduced back in 2020 during initial development. ## Your Environment frostfs-aio v1.3.0
alexvanin added the
bug
label 2023-12-11 11:19:59 +00:00
alexvanin self-assigned this 2023-12-11 11:19:59 +00:00
alexvanin added this to the v0.28.2 milestone 2023-12-14 07:44:40 +00:00
alexvanin removed their assignment 2023-12-20 13:38:33 +00:00
mbiryukova was assigned by alexvanin 2023-12-20 13:38:33 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-s3-gw#280
No description provided.