exclude performance events from non-performance metrics/lists

This commit is contained in:
Francis Cao committed 2026-05-07 14:17:03 -07:00
1 parent 88ccf5348e
commit 17e7a4a63a
16 files changed
+55 -8

No files matched your search

@@ -1,5 +1,5 @@
import clickhouse from '@/lib/clickhouse';
import { DATA_TYPE } from '@/lib/constants';
import { DATA_TYPE, EVENT_TYPE } from '@/lib/constants';
import { CLICKHOUSE, PRISMA, runQuery } from '@/lib/db';
import prisma from '@/lib/prisma';
import type { EventDataSeriesPoint, PropertyFilter, QueryFilters } from '@/lib/types';
@@ -49,6 +49,7 @@ async function relationalQuery(
and session_data.website_id = website_event.website_id
where website_event.website_id = {{websiteId::uuid}}
and website_event.created_at between {{startDate}} and {{endDate}}
and website_event.event_type != ${EVENT_TYPE.performance}
and session_data.data_key = {{propertyName}}
and session_data.data_type in (${DATA_TYPE.string}, ${DATA_TYPE.boolean})
${filterQuery}
@@ -85,6 +86,7 @@ async function clickhouseQuery(
and session_data.website_id = {websiteId:UUID}
where website_event.website_id = {websiteId:UUID}
and website_event.created_at between {startDate:DateTime64} and {endDate:DateTime64}
and website_event.event_type != ${EVENT_TYPE.performance}
and session_data.data_key = {propertyName:String}
and session_data.data_type in (${DATA_TYPE.string}, ${DATA_TYPE.boolean})
${filterQuery}