mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-08 20:38:12 +02:00
core: more metrics (#5629)
## Summary Add some more metrics: - Authenticate token verification - Authorization log duration - Authorization evaluator and header evaluator - IDP token session creator HTTP and gRPC endpoints are already instrumented via middleware, which covers authenticate, proxy and databroker endpoints. Postgres is also already instrumented using `otelpgx`. ## Related issues - [ENG-2407](https://linear.app/pomerium/issue/ENG-2407/add-additional-metrics-and-tracing-spans-to-pomerium) ## Checklist - [x] reference any related issues - [ ] updated unit tests - [ ] add appropriate label (`enhancement`, `bug`, `breaking`, `dependencies`, `ci`) - [x] ready for review
This commit is contained in:
parent
957e0982c1
commit
13554ec78d
8 changed files with 164 additions and 2 deletions
|
@ -2,6 +2,7 @@ package authorize
|
|||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/go-jose/go-jose/v3/jwt"
|
||||
"github.com/rs/zerolog"
|
||||
|
@ -25,6 +26,8 @@ func (a *Authorize) logAuthorizeCheck(
|
|||
ctx, span := a.tracer.Start(ctx, "authorize.grpc.LogAuthorizeCheck")
|
||||
defer span.End()
|
||||
|
||||
start := time.Now()
|
||||
|
||||
hdrs := req.HTTP.Headers
|
||||
impersonateDetails := a.getImpersonateDetails(ctx, s)
|
||||
|
||||
|
@ -59,6 +62,7 @@ func (a *Authorize) logAuthorizeCheck(
|
|||
}
|
||||
|
||||
evt.Msg("authorize check")
|
||||
a.logDuration.Record(ctx, time.Since(start).Milliseconds())
|
||||
}
|
||||
|
||||
type impersonateDetails struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue