feat(aggregation): Add sessionId extraction and propagation logic for session correlation in AggregationService

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
autocommit 2026-06-10 06:01:33 -07:00
parent 8d86bfd1b7
commit 18d0d424fb

View file

@ -54,7 +54,14 @@ export class AggregationService implements OnModuleDestroy {
}
async processEvent(event: ProcessableEvent): Promise<void> {
const { eventType, timestamp, userId, properties } = event;
const { eventType, timestamp, sessionId, userId, properties } = event;
// Synthetic canary events (quinn-analytics-canary.timer) exist to prove
// the tracker→edge→relay→collector→raw_events chain end-to-end. They must
// reach raw_events (that IS the proof) but never count toward metrics.
if (sessionId?.startsWith('canary-')) {
return;
}
const hourBucket = this.getTimeBucket(timestamp, TimeGranularity.HOUR);
const dayBucket = this.getTimeBucket(timestamp, TimeGranularity.DAY);