-
Notifications
You must be signed in to change notification settings - Fork 1.3k
authz: expose metrics of authzFilter
duration
#9264
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9264 +/- ##
==========================================
- Coverage 41.46% 41.36% -0.10%
==========================================
Files 1333 1324 -9
Lines 72296 71858 -438
Branches 6657 6603 -54
==========================================
- Hits 29974 29725 -249
+ Misses 39580 39391 -189
Partials 2742 2742 |
tr, ctx := trace.New(ctx, "authzFilter", "") | ||
defer func() { | ||
if err != nil { | ||
took := time.Now().Sub(began).Seconds() | ||
defer tr.Finish() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this a defer now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just used the same pattern I did for tr.Finish()
in another place. Seems working fine, is there a reason we don't want to use defer tr.Finish()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like an unnecessary defer since there is no early termination. However, it is correct. Was wondering if there was some other reason you changed the code I didn't spot, but lgtm
* Expose metrics of authzFilter duration * Use time.Since to calculate time took * Update CHANGELOG # Conflicts: # dev/Procfile
This PR adds a p95 panel for
authzFilter
duration:Fixes #8612