diff --git a/services/web/app/src/infrastructure/RateLimiter.js b/services/web/app/src/infrastructure/RateLimiter.js index 00b36a5cb9..c39e835d68 100644 --- a/services/web/app/src/infrastructure/RateLimiter.js +++ b/services/web/app/src/infrastructure/RateLimiter.js @@ -27,7 +27,7 @@ const RateLimiter = { } const allowed = timeLeft === 0 if (!allowed) { - Metrics.inc(`rate-limit-hit.${opts.endpointName}`, 1, { + Metrics.inc('rate-limit-hit', 1, { path: opts.endpointName }) } diff --git a/services/web/test/unit/src/infrastructure/RateLimterTests.js b/services/web/test/unit/src/infrastructure/RateLimterTests.js index 9f3d8beaff..40dcc8aaad 100644 --- a/services/web/test/unit/src/infrastructure/RateLimterTests.js +++ b/services/web/test/unit/src/infrastructure/RateLimterTests.js @@ -132,12 +132,9 @@ describe('RateLimiter', function() { return this.limiter.addCount( { endpointName: this.endpointName }, (err, should) => { - sinon.assert.calledWith( - this.Metrics.inc, - `rate-limit-hit.${this.endpointName}`, - 1, - { path: this.endpointName } - ) + sinon.assert.calledWith(this.Metrics.inc, `rate-limit-hit`, 1, { + path: this.endpointName + }) return done() } )