feat(telemetry): exclude configured phones from usage telemetry

- TELEMETRY_EXCLUDE_PHONES resolves to player ids at runtime, cached 10m
- excluded players write no activities, client events, or vitals
- their client errors are still captured
This commit is contained in:
2026-08-25 23:04:14 -07:00
parent c05bdec252
commit 9f5fac2753
6 changed files with 125 additions and 5 deletions
+8 -5
View File
@@ -13,14 +13,17 @@ import type { ActivityInput } from "@/lib/pocketbase/services/activities";
const logger = new Logger("Activities");
export const recordActivity = (activity: ActivityInput) => {
import("@/lib/pocketbase/client")
.then(async ({ pbAdmin }) => {
void (async () => {
try {
const { isExcludedPlayerId } = await import("@/lib/telemetry/exclusions.server");
if (await isExcludedPlayerId(activity.player)) return;
const { pbAdmin } = await import("@/lib/pocketbase/client");
await pbAdmin.authPromise;
await pbAdmin.createActivity(activity);
})
.catch((activityError) => {
} catch (activityError) {
logger.error("Failed to record activity", activityError);
});
}
})();
};
const auditErrorMessage = (