Add configurable channel queue_size for audit/logger webhook targets (#13819)

Also log all the missed events and logs instead of silently
swallowing the events.

Bonus: Extend the logger webhook to support mTLS
similar to audit webhook target.
This commit is contained in:
Harshavardhana
2021-12-20 13:16:53 -08:00
committed by GitHub
parent 5cc16e098c
commit 499872f31d
6 changed files with 134 additions and 19 deletions

View File

@@ -374,7 +374,10 @@ func logIf(ctx context.Context, err error, errKind ...interface{}) {
// Iterate over all logger targets to send the log entry
for _, t := range Targets() {
t.Send(entry, entry.LogKind)
if err := t.Send(entry, entry.LogKind); err != nil {
LogAlwaysIf(context.Background(), fmt.Errorf("event(%v) was not sent to Logger target (%v): %v", entry, t, err), entry.LogKind)
}
}
}