Skip to content

Commit

Permalink
feat(statsd): log anonymous requests
Browse files Browse the repository at this point in the history
  • Loading branch information
geekus committed Apr 28, 2017
1 parent 7ca02b1 commit 12a533d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ module.exports = () => (req, res, next) => {

if (req.user.type === 'token') {
statsd.increment(`http.request.count.${req.user.app.replace(/[^a-zA-Z0-9]/g, '')}`.toLowerCase());
} else {
statsd.increment('http.request.count.anonymous');
}
} catch (err) {
console.error(err); // eslint-disable-line no-console
Expand Down

0 comments on commit 12a533d

Please sign in to comment.