Skip to content

Commit 7317444

Browse files
authored
fix(workflows): dont bill for hogflow invocations (#42599)
1 parent 936f88d commit 7317444

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

plugin-server/src/cdp/consumers/cdp-events-consumer.test.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,5 +534,33 @@ describe('hog flow processing', () => {
534534
teamId: 2,
535535
})
536536
})
537+
538+
it('should not produce billable_invocation metrics for hog flow invocations', async () => {
539+
await insertHogFlow(
540+
new FixtureHogFlowBuilder()
541+
.withTeamId(team.id)
542+
.withSimpleWorkflow({
543+
trigger: {
544+
type: 'event',
545+
filters: HOG_FILTERS_EXAMPLES.pageview_or_autocapture_filter.filters ?? {},
546+
},
547+
})
548+
.build()
549+
)
550+
551+
await processor['createHogFlowInvocations']([globals])
552+
553+
const producedMetrics =
554+
mockProducerObserver.getProducedKafkaMessagesForTopic('clickhouse_app_metrics2_test')
555+
expect(producedMetrics).not.toEqual(
556+
expect.arrayContaining([
557+
expect.objectContaining({
558+
value: expect.objectContaining({
559+
metric_name: 'billable_invocation',
560+
}),
561+
}),
562+
])
563+
)
564+
})
537565
})
538566
})

plugin-server/src/cdp/consumers/cdp-events.consumer.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -375,14 +375,6 @@ export class CdpEventsConsumer extends CdpConsumerBase {
375375
metric_name: 'triggered',
376376
count: 1,
377377
})
378-
379-
triggeredInvocationsMetrics.push({
380-
team_id: item.teamId,
381-
app_source_id: item.functionId,
382-
metric_kind: 'billing',
383-
metric_name: 'billable_invocation',
384-
count: 1,
385-
})
386378
})
387379

388380
this.hogFunctionMonitoringService.queueAppMetrics(triggeredInvocationsMetrics, 'hog_flow')

0 commit comments

Comments
 (0)