Skip metric increment during existence check (#12763)
* Skip metric increment during existence check Signed-off-by: Vinayak Kadam <kadamvinayak03@gmail.com> * Adding changelog.txt Signed-off-by: Vinayak Kadam <kadamvinayak03@gmail.com> * Updated changelog text Signed-off-by: Vinayak Kadam <kadamvinayak03@gmail.com>
This commit is contained in:
parent
1a21b00bf1
commit
988468a67b
|
@ -0,0 +1,3 @@
|
|||
```release-note: bug
|
||||
core: Fix double counting for "route" metrics
|
||||
```
|
|
@ -535,10 +535,12 @@ func (r *Router) routeCommon(ctx context.Context, req *logical.Request, existenc
|
|||
return logical.ErrorResponse(fmt.Sprintf("no handler for route %q. route entry not found.", req.Path)), false, false, logical.ErrUnsupportedPath
|
||||
}
|
||||
req.Path = adjustedPath
|
||||
defer metrics.MeasureSince([]string{
|
||||
"route", string(req.Operation),
|
||||
strings.Replace(mount, "/", "-", -1),
|
||||
}, time.Now())
|
||||
if !existenceCheck {
|
||||
defer metrics.MeasureSince([]string{
|
||||
"route", string(req.Operation),
|
||||
strings.Replace(mount, "/", "-", -1),
|
||||
}, time.Now())
|
||||
}
|
||||
re := raw.(*routeEntry)
|
||||
|
||||
// Grab a read lock on the route entry, this protects against the backend
|
||||
|
|
Loading…
Reference in New Issue