Skip to content

Commit

Permalink
Add metrics counters for audit log failures
Browse files Browse the repository at this point in the history
Fixes #2863
  • Loading branch information
jefferai committed Jul 12, 2017
1 parent fa34455 commit 569a38c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions vault/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,10 @@ func (a *AuditBroker) LogRequest(auth *logical.Auth, req *logical.Request, heade
}

ret = retErr.ErrorOrNil()

if ret != nil {
metrics.IncrCounter([]string{"audit", "log_request_failure"}, 1.0)
}
}()

// All logged requests must have an identifier
Expand Down Expand Up @@ -565,6 +569,10 @@ func (a *AuditBroker) LogResponse(auth *logical.Auth, req *logical.Request,
}

ret = retErr.ErrorOrNil()

if ret != nil {
metrics.IncrCounter([]string{"audit", "log_response_failure"}, 1.0)
}
}()

headers := req.Headers
Expand Down

0 comments on commit 569a38c

Please sign in to comment.