Add telemetry diagnostics route

This commit is contained in:
2026-05-09 05:31:04 -04:00
parent 4e85f31dac
commit c86091a81f
8 changed files with 486 additions and 0 deletions
+8
View File
@@ -11,6 +11,7 @@ export const PUBLIC_KEY = "a".repeat(64);
export interface TestEnvOptions {
auditEvents?: ElyAnalyticsDataPoint[];
diagnosticEvents?: ElyAnalyticsDataPoint[];
d1?: RecordedD1Database;
kvEntries?: [string, string][];
kvReads?: string[];
@@ -68,6 +69,13 @@ export function testEnv(options: TestEnvOptions): Env {
}
},
},
ELY_DIAGNOSTICS: {
writeDataPoint(event?: ElyAnalyticsDataPoint): void {
if (event !== undefined) {
options.diagnosticEvents?.push(event);
}
},
},
};
}