mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-28 08:49:38 +02:00
feat(telemetry): include error details for failures (#254)
This commit is contained in:
parent
494618ab14
commit
6da8c3452a
18 changed files with 1259 additions and 999 deletions
|
|
@ -22,6 +22,7 @@ import type { KtxScanArgs, KtxScanDeps } from './scan.js';
|
|||
import { profileMark } from './startup-profile.js';
|
||||
import { isDemoConnection } from './telemetry/demo-detect.js';
|
||||
import { emitProjectStackSnapshot, emitTelemetryEvent } from './telemetry/index.js';
|
||||
import { formatErrorDetail } from './telemetry/scrubber.js';
|
||||
|
||||
profileMark('module:public-ingest');
|
||||
|
||||
|
|
@ -635,6 +636,9 @@ async function emitIngestCompleted(input: {
|
|||
io: KtxCliIo;
|
||||
}): Promise<void> {
|
||||
const failed = resultFailed(input.result);
|
||||
const failureDetail = failed
|
||||
? formatErrorDetail(input.result.steps.find((step) => step.status === 'failed')?.detail)
|
||||
: undefined;
|
||||
await emitTelemetryEvent({
|
||||
name: 'ingest_completed',
|
||||
projectDir: input.args.projectDir,
|
||||
|
|
@ -651,6 +655,7 @@ async function emitIngestCompleted(input: {
|
|||
rowsBucket: rowsBucket(),
|
||||
durationMs: Math.max(0, performance.now() - input.startedAt),
|
||||
outcome: failed ? 'error' : 'ok',
|
||||
...(failureDetail ? { errorDetail: failureDetail } : {}),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue