This commit is contained in:
Soph :3 2025-11-02 12:57:53 +02:00
parent 2911d4f0e7
commit 2928ef3c45

View file

@ -148,15 +148,11 @@ app.post("/some-cool-endpoint", (req, res) => {
} }
let path = "/"; let path = "/";
if (typeof e.path === "string" && e.path) { try {
path = e.path.startsWith("/") ? e.path : `/${e.path}`; if (e.url) {
} else { path = new URL(e.url).pathname || "/";
try {
if (e.url) {
path = new URL(e.url).pathname || "/";
}
} catch (err) {
} }
} catch (err) {
} }
eventCounter.labels(site, e.type, path, country, device, browser, os).inc(); eventCounter.labels(site, e.type, path, country, device, browser, os).inc();