Skip to content
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: New grouped invocation logs view #29131

Merged
merged 17 commits into from
Feb 26, 2025
Merged

Conversation

benjackwhite
Copy link
Contributor

@benjackwhite benjackwhite commented Feb 24, 2025

Problem

The logs view is somewhat limited as it is just a list without any grouping.

This modifies it to allow grouping by instance_id (invocation)

Changes

2025-02-25 13 53 57

  • Adds a new component (as this only applies to hog functions and we can swap over to it fully later)
  • Adds ability to click any row to expand it and load older / newer logs
  • Filters invocations if any result contains
  • Adds retry button for the events
  • Fixes an issue with bytecode being removed if the hog isn't sent

TODO

  • Add a filter for date range

FOLLOW UP

  • Persist logs and use real URLs etc.
  • Add option when testing to bypass filtering
  • Add option when testing to give the invocation ID (and persist logs)

👉 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?

Copy link
Contributor

github-actions bot commented Feb 25, 2025

Size Change: 0 B

Total Size: 9.72 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 9.72 MB

compressed-size-action

@benjackwhite benjackwhite requested a review from a team February 25, 2025 15:26
@benjackwhite benjackwhite marked this pull request as ready for review February 25, 2025 15:26
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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 new grouped invocation logs view for hog functions, enhancing the logging experience with invocation-based grouping and expanded functionality.

  • Added new HogFunctionLogs component in frontend/src/scenes/pipeline/PipelineNode.tsx that groups logs by invocation ID
  • Implemented expandable rows to load older/newer logs when clicked
  • Added filtering capability to show invocations where any result contains the search term
  • Fixed bug in posthog/api/hog_function.py that was resetting bytecode when the hog field wasn't included in requests
  • Added retry button functionality for errored events

2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +29 to +45
return {
event: {
uuid,
distinct_id,
event,
properties: JSON.parse(properties),
timestamp,
url: '',
elements_chain: '',
},
person: {
id: person_id,
properties: JSON.parse(person_properties),
url: '',
name: '',
},
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break retries for functions that are using group, project, or source values.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true 🤔
Although the intention was to get that stuff done via the API rather than rebuilding everything client side which is a little less reliable.

In reality almost nothing uses those elements but still should fix it...

@benjackwhite benjackwhite merged commit fe4555d into master Feb 26, 2025
97 checks passed
@benjackwhite benjackwhite deleted the feat/retry-errored-events branch February 26, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants