Skip to content

Commit

Permalink
Add metrics counters for audit log failures (#3001)
Browse files Browse the repository at this point in the history
Fixes #2863
  • Loading branch information
jefferai authored Jul 14, 2017
1 parent 2404b64 commit 4e4c9aa
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 4e4c9aa

Please sign in to comment.