Skip to content

Commit

Permalink
better message
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra committed Dec 17, 2024
1 parent b767a6b commit 6e7b0e0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion plugin-server/src/cdp/cdp-consumers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ abstract class CdpConsumerBase {
instance_id: new UUIDT().toString(), // random UUID, like it would be for an invocation
timestamp: castTimestampOrNow(null, TimestampFormat.ClickHouse),
level: 'error',
message: `Error filtering: ${error}`,
message: error,
}

this.messagesToProduce.push({
Expand Down
18 changes: 12 additions & 6 deletions plugin-server/src/cdp/hog-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ export class HogExecutor {
this.telemetryMatcher = buildIntegerMatcher(this.hub.CDP_HOG_FILTERS_TELEMETRY_TEAMS, true)
}

findMatchingFunctions(event: HogFunctionInvocationGlobals): {
findMatchingFunctions(globals: HogFunctionInvocationGlobals): {
matchingFunctions: HogFunctionType[]
nonMatchingFunctions: HogFunctionType[]
erroredFunctions: [HogFunctionType, string][]
} {
const allFunctionsForTeam = this.hogFunctionManager.getTeamHogDestinations(event.project.id)
const filtersGlobals = convertToHogFunctionFilterGlobal(event)
const allFunctionsForTeam = this.hogFunctionManager.getTeamHogDestinations(globals.project.id)
const filtersGlobals = convertToHogFunctionFilterGlobal(globals)

const nonMatchingFunctions: HogFunctionType[] = []
const matchingFunctions: HogFunctionType[] = []
Expand All @@ -143,7 +143,10 @@ export class HogExecutor {
error: filterResult.error.message,
result: filterResult,
})
erroredFunctions.push([hogFunction, filterResult.error.message])
erroredFunctions.push([
hogFunction,
`Error filtering event ${globals.event.uuid}: ${filterResult.error.message}`,
])
return
}
} catch (error) {
Expand All @@ -153,7 +156,10 @@ export class HogExecutor {
teamId: hogFunction.team_id,
error: error.message,
})
erroredFunctions.push([hogFunction, error.message])
erroredFunctions.push([
hogFunction,
`Error filtering event ${globals.event.uuid}: ${error.message}`,
])
return
} finally {
const duration = performance.now() - start
Expand All @@ -165,7 +171,7 @@ export class HogExecutor {
hogFunctionName: hogFunction.name,
teamId: hogFunction.team_id,
duration,
eventId: event.event.uuid,
eventId: globals.event.uuid,
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ describe('CDP Processed Events Consumer', () => {
{
topic: 'log_entries_test',
value: {
message: 'Error filtering: Invalid HogQL bytecode, stack is empty, can not pop',
message:
'Error filtering event b3a1fe86-b10c-43cc-acaf-d208977608d0: Invalid HogQL bytecode, stack is empty, can not pop',
},
},
])
Expand Down

0 comments on commit 6e7b0e0

Please sign in to comment.