mirror of
https://github.com/hashicorp/vault.git
synced 2026-02-03 20:40:45 -05: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:
parent
c00201e57d
commit
c22aa710a5
2 changed files with 9 additions and 4 deletions
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue