From 280e1745f68d35427464c5ec20159a7957e700cb Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 7 Apr 2024 00:24:58 +0200 Subject: Make prometheus metric labels strongly typed --- src/app.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app.ts b/src/app.ts index 72708b6..4765811 100644 --- a/src/app.ts +++ b/src/app.ts @@ -45,12 +45,12 @@ const metrics = { "hostname", "method", "content_encoding", - ], + ] as const, }), requestDuration: new prom.Histogram({ name: "homestead_request_duration_seconds", help: "Request duration in seconds", - labelNames: ["path"], + labelNames: ["path"] as const, }), }; -- cgit 1.4.1