feat: Add request logging and traffic metrics for API performance monitoring

This commit is contained in:
2026-10-20 23:31:08 +03:00
parent e28d65310d
commit de72d003b8
6 changed files with 304 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ import { createHash } from "node:crypto";
import { parseWeeksDocx, parseBellsDocx } from "./calendar.js";
import { apiError, sourceError } from "./errors.js";
import { DATA } from "./paths.js";
import { sourceFailed } from "./metrics.js";
import {
academicStartYear,
assignSemesters,
@@ -78,6 +79,7 @@ export async function request(path, method = "GET") {
}
return Buffer.concat(chunks);
} catch (error) {
sourceFailed();
throw sourceError(error);
}
}