Skip to content

Commit 3cc76f4

Browse files
committed
Ensure correlationId is used in filtering observability
1 parent d9f38e2 commit 3cc76f4

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

lambdas/client-transform-filter-lambda/src/handler.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,15 @@ async function filterBatch(
215215

216216
for (const event of transformedEvents) {
217217
const { clientId } = event.data;
218+
const correlationId = extractCorrelationId(event);
218219
const config = configByClientId.get(clientId);
219220
const filterResult = evaluateSubscriptionFilters(event, config);
220221

221222
if (filterResult.matched) {
222223
filtered.push(event);
223224
const targetIds = config?.targets?.map((t) => t.targetId);
224225
observability.recordFilteringMatched({
226+
correlationId,
225227
clientId,
226228
eventType: event.type,
227229
subscriptionType: filterResult.subscriptionType,
@@ -232,6 +234,7 @@ async function filterBatch(
232234
observability
233235
.getLogger()
234236
.info("Event filtered out - no matching subscription", {
237+
correlationId,
235238
clientId,
236239
eventType: event.type,
237240
subscriptionType: filterResult.subscriptionType,

lambdas/client-transform-filter-lambda/src/services/observability.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export class ObservabilityService {
4545
}
4646

4747
recordFilteringMatched(context: {
48+
correlationId?: string;
4849
clientId: string;
4950
eventType: string;
5051
subscriptionType: string;

0 commit comments

Comments
 (0)