-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Persist retried hog function logs #29193
base: master
Are you sure you want to change the base?
Conversation
Size Change: 0 B Total Size: 9.72 MB ℹ️ View Unchanged
|
# Conflicts: # frontend/src/scenes/pipeline/hogfunctions/logs/hogFunctionLogsLogic.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR introduces a centralized approach to handling logs and metrics for hog functions through a new HogFunctionMonitoringService class, focusing on persisting logs during retries.
- Added new
HogFunctionMonitoringService
class that centralizes log and metric production functionality - Modified
CdpCyclotronWorker
to use the monitoring service for processing invocation results and producing messages - Added support for custom invocation IDs in the API to maintain log continuity across retries
- Updated
cdp-api.ts
to handle ClickHouse events and ensure logs are properly persisted even in error cases - Refactored
CdpProcessedEventsConsumer
to use the monitoring service instead of direct log/metric production - Simplified API interfaces in Python code by using a more flexible payload-based approach
9 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
.catch((reason) => { | ||
status.error('⚠️', `failed to produce message: ${reason}`) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Error is logged but not propagated. Consider returning a result indicating success/failure or throwing the error to allow callers to handle it.
this.messagesToProduce.push({ | ||
topic: KAFKA_EVENTS_PLUGIN_INGESTION, | ||
value: convertToCaptureEvent(event, team), | ||
key: `${team!.api_token}:${event.distinct_id}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: The non-null assertion operator (!) is redundant here since the if-check on line 112 already ensures team is not null.
key: `${team!.api_token}:${event.distinct_id}`, | |
key: `${team.api_token}:${event.distinct_id}`, |
Problem
Follow up from other PR
Changes
Follow up
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Does this work well for both Cloud and self-hosted?
How did you test this code?