Skip to content

Commit

Permalink
fix: apiUsageMonitoring to be able to observe client timeout error ca…
Browse files Browse the repository at this point in the history
…se and record 499 status codes (#2270)

Signed-off-by: Sandor Szücs <[email protected]>
  • Loading branch information
szuecs authored Apr 14, 2023
1 parent 5c0845e commit 3c60b4e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions filters/apiusagemonitoring/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ type apiUsageMonitoringStateBag struct {
begin time.Time
}

// HandleErrorResponse is to opt-in for filters to get called
// Response(ctx) in case of errors via proxy. It has to return true to
// opt-in.
func (f *apiUsageMonitoringFilter) HandleErrorResponse() bool { return true }

func (f *apiUsageMonitoringFilter) Request(c filters.FilterContext) {
u := *c.Request().URL
c.StateBag()[stateBagKey] = apiUsageMonitoringStateBag{
Expand Down

0 comments on commit 3c60b4e

Please sign in to comment.