mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 02:02:43 +00:00
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:
3
changelog/12763.txt
Normal file
3
changelog/12763.txt
Normal file
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user