Skip to content

Commit

Permalink
fix: Disable observing fetch results for now (#24219)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite authored Aug 6, 2024
1 parent 4f35a7e commit f676483
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions plugin-server/src/cdp/cdp-consumers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,36 +257,14 @@ abstract class CdpConsumerBase {
return await runInstrumentedFunction({
statsKey: `cdpConsumer.handleEachBatch.executeAsyncResponses`,
func: async () => {
this.hogWatcher.currentObservations.observeAsyncFunctionResponses(asyncResponses)
// NOTE: Disabled for now as it needs some rethinking
// this.hogWatcher.currentObservations.observeAsyncFunctionResponses(asyncResponses)
asyncResponses.forEach((x) => {
counterAsyncFunctionResponse.inc({
outcome: x.asyncFunctionResponse.error ? 'failed' : 'succeeded',
})
})

// Filter for blocked functions
const asyncResponsesToRun: HogFunctionInvocationAsyncResponse[] = []

for (const item of asyncResponses) {
const functionState = this.hogWatcher.getFunctionState(item.hogFunctionId)

if (functionState > HogWatcherState.disabledForPeriod) {
this.produceAppMetric({
team_id: item.teamId,
app_source_id: item.hogFunctionId,
metric_kind: 'failure',
metric_name:
functionState === HogWatcherState.disabledForPeriod
? 'disabled_temporarily'
: 'disabled_permanently',
count: 1,
})
continue
} else {
asyncResponsesToRun.push(item)
}
}

const invocationsWithResponses: [HogFunctionInvocation, HogFunctionAsyncFunctionResponse][] = []

// Deserialize the compressed data
Expand Down

0 comments on commit f676483

Please sign in to comment.