Files
teleport/lib/auth/authclient
Tiago Silva 07160ff994 audit: optimize JSON marshaling operations when reading unstructured events (#55564)
* audit: optimize JSON marshaling operations when reading unstructured events

Reduce the number of JSON marshal/unmarshal operations in GetUnstructuredEvents
to improve performance when reading audit logs from Teleport.

Previously, reading unstructured events involved 6 operations:
  1. Read data from backend
  2. JSON unmarshal to events.EventFields
  3. Marshal to JSON
  4. JSON unmarshal to events satisfying apievents.AuditEvent
  5. Marshal to JSON
  6. Protojson unmarshal to structpb.Struct

This optimization reduces the process to 3 operations:
  1. Read data from backend
  2. JSON unmarshal to events.EventFields
  3. Direct conversion using structpb.NewStruct(fields)

This change minimizes JSON marshal/unmarshal overhead while maintaining
unchanged the non-unstructured endpoints (steps 1-4 remain unchanged).

* prevent returning non-nil error and nextKey
2025-06-17 15:30:23 +00:00
..