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:
@@ -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 = (
|
||||
|
||||
Reference in New Issue
Block a user