Add Prometheus metrics endpoint #14

Merged
localhorst merged 12 commits from feat/prometheus into main 2025-01-26 10:03:28 +01:00
Showing only changes of commit 85e3509731 - Show all commits
+2 -2
View File
@@ -51,8 +51,8 @@ router.get("/", async (req: Request, res: Response) => {
locationsTotal.set((await locationService.getAllLocations()).length); locationsTotal.set((await locationService.getAllLocations()).length);
wifiLocationTotal.set((await wifiLocationService.getAllWifiLocations()).length); wifiLocationTotal.set((await wifiLocationService.getAllWifiLocations()).length);
wifiLocationNotResolvable.set((await wifiLocationService.getAllWifiLocationsByNotResolvable).length); wifiLocationNotResolvable.set((await wifiLocationService.getAllWifiLocationsByNotResolvable()).length);
wifiLocationRequestLimitExceeded.set((await wifiLocationService.getAllWifiLocationsByRequestLimitExceeded).length); wifiLocationRequestLimitExceeded.set((await wifiLocationService.getAllWifiLocationsByRequestLimitExceeded()).length);
// Increment the counter with labels // Increment the counter with labels
requestCounter.inc({ method: req.method, route: req.route.path, status: 200 }); requestCounter.inc({ method: req.method, route: req.route.path, status: 200 });
localhorst marked this conversation as resolved Outdated
Outdated
Review

Ich würde das in eine extra Datei auslagern

Ich würde das in eine extra Datei auslagern
1