From e4649e6421746995f610283b4a01e21d7833b017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Thu, 15 Feb 2024 17:05:52 +0000 Subject: [PATCH] chore: add call incoming webhook rate limit metric (#6252) Follow up to https://github.com/Unleash/unleash/pull/6248 - Add this rate limit to metrics. ![image](https://github.com/Unleash/unleash/assets/14320932/6b458f5d-2e13-4ac4-8331-7950e7784585) --- src/lib/metrics.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib/metrics.ts b/src/lib/metrics.ts index 7a448ed5a8..98225f49ff 100644 --- a/src/lib/metrics.ts +++ b/src/lib/metrics.ts @@ -355,6 +355,15 @@ export default class MetricsMonitor { rateLimits .labels({ endpoint: '/auth/simple', method: 'POST' }) .set(config.rateLimiting.simpleLoginMaxPerMinute); + rateLimits + .labels({ + endpoint: '/api/incoming-webhook/:name', + method: 'POST', + }) + .set( + config.rateLimiting.callIncomingWebhookMaxPerSecond * + 60, + ); } catch (e) {} }