From 5a1edeee051ac79fec75b214ffa5cb647c1baf63 Mon Sep 17 00:00:00 2001
From: Will Hunt <will@half-shot.uk>
Date: Thu, 18 Jun 2020 11:07:34 +0100
Subject: [PATCH] Update metric types

---
 src/metrics.ts | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/metrics.ts b/src/metrics.ts
index d5a7b10..52f4028 100644
--- a/src/metrics.ts
+++ b/src/metrics.ts
@@ -57,20 +57,18 @@ export class MetricPeg {
 }
 
 export class PrometheusBridgeMetrics implements IBridgeMetrics {
-    private matrixCallCounter: Counter;
-    private remoteCallCounter: Counter;
-    private storeCallCounter: Counter;
-    private presenceGauge: Gauge;
-    private remoteRequest: Histogram;
-    private matrixRequest: Histogram;
+    private matrixCallCounter: Counter<string>;
+    private remoteCallCounter: Counter<string>;
+    private storeCallCounter: Counter<string>;
+    private presenceGauge: Gauge<string>;
+    private remoteRequest: Histogram<string>;
+    private matrixRequest: Histogram<string>;
     private requestsInFlight: Map<string, number>;
     private matrixRequestStatus: Map<string, "success"|"failed">;
     private httpServer: http.Server;
 
     public init(as: Appservice, config: DiscordBridgeConfigMetrics) {
-        promClient.collectDefaultMetrics({
-            timeout: 15000,
-        });
+        promClient.collectDefaultMetrics();
         // TODO: Bind this for every user.
         this.httpServer = http.createServer((req, res) => {
             if (req.method !== "GET" || req.url !== "/metrics") {
-- 
GitLab