The openlane API supports impersonation of users to do things like:
- run jobs on behalf of a user
- temporary access for support
- etc.
It would be nice to have metrics added to track counts of requests:
Add metrics with the type (start/stop) and increment the count
Handler:
|
func (h *Handler) logImpersonationEvent(action string, auditLog *auth.ImpersonationAuditLog) error { |
The new metric can be added to the metrics package:
https://github.com/theopenlane/core/blob/main/pkg/metrics/vars.go
With a helper added to the metrics/helpers.go:
https://github.com/theopenlane/core/blob/main/pkg/metrics/helpers.go
The openlane API supports impersonation of users to do things like:
It would be nice to have metrics added to track counts of requests:
Add metrics with the type (start/stop) and increment the count
Handler:
core/internal/httpserve/handlers/impersonation.go
Line 245 in 33f16f9
The new metric can be added to the metrics package:
https://github.com/theopenlane/core/blob/main/pkg/metrics/vars.go
With a helper added to the metrics/helpers.go:
https://github.com/theopenlane/core/blob/main/pkg/metrics/helpers.go