Skip to content

Commit

Permalink
add reason to user error
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaamani committed Jul 25, 2023
1 parent a58a175 commit 500edc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const metrics = {
register_failure_user: new prom.Counter({
name: 'register_failure_user',
help: 'Failure due user input.',
labelNames: ['code'],
labelNames: ['code', 'reason'],
}),
register_failure_server: new prom.Counter({
name: 'register_failure_server',
Expand Down Expand Up @@ -125,7 +125,7 @@ app.post('/register', async (req, res) => {
1
)
} else if (statusCode >= 400) {
metrics.register_failure_user.inc({ code: statusCode }, 1)
metrics.register_failure_user.inc({ code: statusCode, reason: error }, 1)
} else {
metrics.register_success.inc({ code: statusCode }, 1)
}
Expand Down

0 comments on commit 500edc7

Please sign in to comment.