‹ Reports
The Dispatch

OSS Watchlist: posthog/posthog


Executive Summary

PostHog is an open-source analytics platform designed for product analytics, including features like event tracking, session recording, feature flagging, and A/B testing. It is built with a focus on privacy and security, allowing users to self-host their instances. The project exhibits a healthy state with ongoing development efforts aimed at enhancing functionality, improving user experience, and maintaining system integrity. Its trajectory suggests a commitment to addressing user needs through technological advancements and optimizations.

Notable elements of the project include:

Recent Activity

Recent activities highlight a dynamic development team working on various aspects of the platform:

Team members like Bianca Yang, Brett Hoerner, and Eric Duong have contributed significantly across different areas, indicating a collaborative effort towards platform enhancement.

Risks

Notable issues and risks identified include:

Plans

Work in progress or notable todos include:

Conclusion

PostHog demonstrates a strong commitment to advancing its analytics platform through continuous improvements in functionality, user experience, and system integrity. The project's active development cycle, coupled with a focus on quality and reliability, positions it well for future growth. However, attention to managing complexity, especially in backend configurations, and ensuring robust dependency management will be crucial for maintaining its upward trajectory.

Quantified Commit Activity Over 9 Days

Developer Avatar Branches PRs Commits Files Changes
Julian Bez 2 12/6/0 9 103 10733
vs. last report +2 +12/+6/-1 +9 +103 +10733
David Newell 1 2/3/0 3 8 4072
vs. last report = -7/-4/-1 -5 -276 +2766
Michael Matloka 1 7/6/1 6 39 777
vs. last report = -4/-2/= -2 -48 +191
Tom Owers 1 3/5/0 5 24 765
vs. last report = =/+3/= +3 +18 +728
Tiina Turban 1 7/6/0 6 39 630
vs. last report = +4/+5/= +3 +26 +279
Robbie 2 6/3/0 6 34 608
vs. last report = +2/-1/= -1 +17 -245
Eric Duong 1 10/8/0 8 11 540
vs. last report = +2/-1/= -1 -31 -543
timgl 1 3/3/0 3 40 462
vs. last report = +1/+3/= +2 +38 +459
ted kaemming 1 3/2/1 2 18 417
vs. last report = =/-2/+1 -3 +2 +115
Ben White 1 1/1/0 4 18 371
vs. last report = -3/=/= +3 +15 +283
Tomás Farías Santana 1 4/2/1 2 7 359
vs. last report = +4/+1/+1 +1 -15 -549
Nikita Vorobev 1 2/1/0 2 10 291
vs. last report = -1/=/= +1 +9 +288
Brett Hoerner 2 4/3/1 4 13 263
vs. last report +1 -1/=/-1 +1 +5 +148
Juraj Majerik 1 2/0/0 1 8 191
vs. last report = -3/-3/= -2 -6 -524
Paul D'Ambra 1 4/2/0 3 11 141
vs. last report = -9/-8/= -9 -31 -2799
Zach Waterfield 1 1/0/0 1 5 129
vs. last report -1 -3/-7/= -8 -22 -224
PostHog Bot 1 12/10/1 10 4 123
vs. last report = +10/+8/+1 +8 +2 +103
Cory Watilo 1 0/1/0 1 16 114
Marcus Hof 1 5/3/0 3 5 102
vs. last report = +3/+2/= +2 +2 +68
Raquel Smith 1 2/2/0 2 5 83
vs. last report = -1/=/= = -4 -123
Thomas Obermüller 1 3/3/0 3 8 73
vs. last report = -1/=/= -1 -116 -2471
Steven Shults 1 2/0/0 5 1 71
Neil Kakkar 1 2/2/1 2 4 71
vs. last report = -2/-1/+1 -1 -2 -556
Bianca Yang 1 1/1/0 1 9 57
vs. last report = =/=/= = +6 -261
Frank Hamand 1 7/7/0 7 2 56
Xavier Vello 1 5/3/0 3 2 37
vs. last report = +2/-1/-1 -1 -17 -707
dependabot[bot] 1 4/0/0 1 2 22
vs. last report +1 +2/=/= +1 +2 +22
Joe Martin 1 2/1/0 1 7 15
James Greenhill 1 1/2/0 2 3 10
vs. last report = =/+1/= = -1 -346
Jacob Gillespie 1 1/1/0 1 2 8
Steven Miller (sjmiller609) 0 1/0/0 0 0 0

PRs: created by that dev and opened/merged/closed-unmerged during the period

Detailed Reports

Report On: Fetch commits



Recent Development Activities:

Project Overview:

Since the last report 9 days ago, the PostHog development team has been actively engaged in enhancing the platform's features and addressing various issues. The activities have spanned across multiple aspects of the project including user interface improvements, backend optimizations, and updates to the documentation and testing frameworks.

Team Contributions:

  • Bianca Yang (xrdt) has been involved in implementing a scoring system for trusted customers and handling migrations related to this new feature.
  • Brett Hoerner (bretthoerner) focused on refining the plugin server's functionality, particularly around ingestion warnings and Kafka message handling.
  • Eric Duong (EDsCODE) worked on data warehouse integrations, specifically adding new table definitions and improving UI responsiveness.
  • Frank Hamand (frankh) contributed to infrastructure improvements by testing new CI/CD pipelines and adjusting configurations.
  • Julian Bez (webjunkie) made significant contributions to error handling in asynchronous queries and optimized loading mechanisms for insights.
  • Michael Matloka (Twixes) was active in refining the insights feature, including adjustments to async querying and timeout handling.
  • Neil Kakkar (neilkakkar) enhanced the experimentation features by implementing significance calculations for secondary metrics.
  • Paul D'Ambra (pauldambra) focused on improving error handling and logging within the platform's ingestion pipeline.
  • Raquel Smith (raquelmsmith) worked on enhancing the billing features, including UI tweaks and backend logic adjustments.
  • Robbie (robbie-c) contributed to the web analytics feature by adding session filters and improving data node collection logic.
  • Thomas Obermüller (thmsobrmlr) improved the insights feature by fixing issues related to breakdowns in funnels.
  • Tiina Turban (tiina303) focused on pipeline UI enhancements and integrating new plugins for batch exports.

Branch Activity:

Several branches have been active, with contributions focusing on bug fixes, feature enhancements, and testing improvements. Notable branches include:

  • bug_report_template-update by Steven Shults (slshults) aimed at updating bug report templates.
  • add-session-filters by Robbie (robbie-c) focused on adding session filters to web analytics queries.
  • billing-q2-auto-subscribe-new-users by Zach Waterfield (zlwaterfield) which dealt with auto-subscribing new users to all products.

Conclusions:

The PostHog development team continues to demonstrate a strong commitment to enhancing the platform's functionality and user experience. The recent activities indicate a balanced focus on both front-end improvements and back-end stability, ensuring that PostHog remains a robust solution for product analytics. The ongoing efforts in optimizing data handling and improving integration capabilities are particularly noteworthy, reflecting the team's proactive approach to addressing user needs and technological advancements.

Quantified Commit Activity Over 7 Days

Developer Avatar Branches PRs Commits Files Changes
Julian Bez 2 12/6/0 9 103 10733
vs. last report +2 +12/+6/-1 +9 +103 +10733
David Newell 1 2/3/0 3 8 4072
vs. last report = -7/-4/-1 -5 -276 +2766
Michael Matloka 1 7/6/1 6 39 777
vs. last report = -4/-2/= -2 -48 +191
Tom Owers 1 3/5/0 5 24 765
vs. last report = =/+3/= +3 +18 +728
Tiina Turban 1 7/6/0 6 39 630
vs. last report = +4/+5/= +3 +26 +279
Robbie 2 6/3/0 6 34 608
vs. last report = +2/-1/= -1 +17 -245
Eric Duong 1 10/8/0 8 11 540
vs. last report = +2/-1/= -1 -31 -543
timgl 1 3/3/0 3 40 462
vs. last report = +1/+3/= +2 +38 +459
ted kaemming 1 3/2/1 2 18 417
vs. last report = =/-2/+1 -3 +2 +115
Ben White 1 1/1/0 4 18 371
vs. last report = -3/=/= +3 +15 +283
Tomás Farías Santana 1 4/2/1 2 7 359
vs. last report = +4/+1/+1 +1 -15 -549
Nikita Vorobev 1 2/1/0 2 10 291
vs. last report = -1/=/= +1 +9 +288
Brett Hoerner 2 4/3/1 4 13 263
vs. last report +1 -1/=/-1 +1 +5 +148
Juraj Majerik 1 2/0/0 1 8 191
vs. last report = -3/-3/= -2 -6 -524
Paul D'Ambra 1 4/2/0 3 11 141
vs. last report = -9/-8/= -9 -31 -2799
Zach Waterfield 1 1/0/0 1 5 129
vs. last report -1 -3/-7/= -8 -22 -224
PostHog Bot 1 12/10/1 10 4 123
vs. last report = +10/+8/+1 +8 +2 +103
Cory Watilo 1 0/1/0 1 16 114
Marcus Hof 1 5/3/0 3 5 102
vs. last report = +3/+2/= +2 +2 +68
Raquel Smith 1 2/2/0 2 5 83
vs. last report = -1/=/= = -4 -123
Thomas Obermüller 1 3/3/0 3 8 73
vs. last report = -1/=/= -1 -116 -2471
Steven Shults 1 2/0/0 5 1 71
Neil Kakkar 1 2/2/1 2 4 71
vs. last report = -2/-1/+1 -1 -2 -556
Bianca Yang 1 1/1/0 1 9 57
vs. last report = =/=/= = +6 -261
Frank Hamand 1 7/7/0 7 2 56
Xavier Vello 1 5/3/0 3 2 37
vs. last report = +2/-1/-1 -1 -17 -707
dependabot[bot] 1 4/0/0 1 2 22
vs. last report +1 +2/=/= +1 +2 +22
Joe Martin 1 2/1/0 1 7 15
James Greenhill 1 1/2/0 2 3 10
vs. last report = =/+1/= = -1 -346
Jacob Gillespie 1 1/1/0 1 2 8
Steven Miller (sjmiller609) 0 1/0/0 0 0 0

PRs: created by that dev and opened/merged/closed-unmerged during the period

Report On: Fetch issues



Analysis of Recent Activity

Overview

Since the last report 9 days ago, there has been a significant amount of activity in the repository. This includes both the opening and closing of numerous issues, as well as ongoing discussions and updates on existing issues.

Notable New Issues

  1. Issue #21517: Clean up the pay gate mini component

    • Created recently and involves cleaning up a component by refactoring it into multiple smaller components for better readability and maintenance.
    • Link to Issue
  2. Issue #21515: Allow other session properties beyond $session_duration

    • This issue addresses enhancing session properties beyond just duration, indicating an expansion in the functionality of session analysis.
    • Link to Issue
  3. Issue #21514: Fix UI glitch with HogQL expression as aggregation

    • Focuses on a UI issue where certain fields overflow, suggesting ongoing improvements in user interface design.
    • Link to Issue
  4. Issue #21513: Fix insights export size

    • Addresses a critical issue where exported insights are cut off, impacting user ability to utilize exported data effectively.
    • Link to Issue
  5. Issue #21512: Session filters 1

    • Indicates efforts to enhance analytical capabilities by introducing session filters, showing a focus on deepening data analysis tools.
    • Link to Issue

Recently Closed Issues

  1. Issue #21518: Delay sending usage reports until 2am

    • Was quickly closed after creation, suggesting rapid decision-making or reevaluation of the approach.
    • Link to Issue
  2. Issue #21516: Update posthog-js to 1.121.2

    • Closed shortly after being opened, reflecting routine dependency updates that are promptly handled.
    • Link to Issue
  3. Issue #21510: Wait for DBs before starting Temporal

    • A technical issue related to CI processes that was resolved quickly, indicating efficient problem-solving in development operations.
    • Link to Issue

General Trends

  • There is a significant focus on improving user experience through UI enhancements and bug fixes.
  • Efforts are being made to expand the analytical capabilities of PostHog, as seen with the introduction of new session properties and filters.
  • Dependency management remains a routine part of the project's maintenance, with updates being handled swiftly.
  • The quick opening and closing of some issues suggest a dynamic and responsive development environment where decisions are made quickly.

Conclusion

The recent activity in the PostHog repository indicates a healthy and active development cycle focused on both expanding features and maintaining the existing system's integrity and usability. The project's responsiveness to issues, both in terms of introducing enhancements and resolving bugs, suggests a strong commitment to user satisfaction and continuous improvement.

Report On: Fetch pull requests



Analysis of Recent Activity on Pull Requests

Overview

Since the last analysis 9 days ago, there has been a significant amount of activity in the repository. Several pull requests (PRs) have been opened, closed, or merged. The focus of these PRs ranges from dependency updates and bug fixes to new features and performance improvements.

Notable Closed PRs Without Merge

  • PR #21520: This PR aimed to reintroduce support for distinct_id-based person overrides in HogQL but was closed without being merged. It's crucial to understand why this change was not incorporated, as it could impact future developments related to HogQL and person ID handling.

  • PR #21517: Aimed at cleaning up a component for better readability and maintainability. While it was closed without merging, the reasons behind this decision are not clear from the provided data. It might be worth investigating if the changes were unnecessary or if they were integrated through another PR.

Significant Merged PRs

  • PR #21523: Introduced a new feature for live activity tracking in the toolbar. This feature enhances real-time user interaction tracking, which could be significant for user experience improvements.

  • PR #21487: Focused on improving heatmap ingestion by creating a separate table for heatmap events. This change is likely to enhance performance and scalability for features that rely heavily on heatmap data.

Open PRs Needing Attention

  • Several PRs have been open for a while without recent updates:
    • PR #21494: Aims to improve message parsing performance in blobby.
    • PR #21480: Introduces a command to recreate a month's data in the sessions table.
    • PR #21476: Updates psycopg to use a version that includes bundled system dependencies.

These PRs address important performance improvements and bug fixes that could significantly impact system stability and efficiency.

Summary

The recent activity indicates a healthy development environment with ongoing efforts to enhance functionality, fix bugs, and improve performance. However, some closed PRs without merging could indicate missed opportunities or unresolved challenges that may need revisiting. The open PRs suggest that there are still several enhancements in the pipeline that require completion or further review.

Report On: Fetch PR 21523 For Assessment



Analysis of Pull Request #21523 for PostHog/posthog

Overview

This pull request introduces a new feature called "toolbar-live-activity" which enhances the toolbar functionality in the PostHog analytics platform. The feature appears to allow users to view live events and debug them directly from the toolbar, providing immediate insights into event capture and processing.

Code Changes

  • New Feature Implementation: The main changes include the addition of new components (EventDebugMenu and eventDebugMenuLogic) that handle the display and logic of live event debugging.
  • UI Enhancements: Modifications to existing UI components (Toolbar.tsx, Toolbar.scss) to accommodate the new feature, including a new button for toggling the event debugger view.
  • Dependencies: The PR updates the posthog-js dependency to a local version, which suggests that this PR depends on changes in the posthog-js library that are not yet published.

Code Quality Assessment

  1. Clarity and Maintainability:

    • The new code is relatively clear and includes adequate naming conventions. Logic related to the new feature is encapsulated in specific files (EventDebugMenu.tsx, eventDebugMenuLogic.ts), which is good for maintainability.
    • Use of TypeScript for type safety is evident, which is beneficial for reducing runtime errors and improving code quality.
  2. Functionality:

    • The feature introduces a toggle switch within the toolbar to view live events, which enhances user interactivity and provides a real-time debugging tool directly within the UI.
    • The use of Kea (state management for React) suggests that the state handling is robust, benefiting from Kea's capabilities such as logic reuse and full TypeScript support.
  3. Scalability:

    • The implementation uses existing patterns and frameworks (like Kea), which are already used within the PostHog project. This consistency helps with scalability as it leverages familiar patterns and tools that are scalable by design.
  4. Security and Performance Considerations:

    • There are no obvious security concerns in the diff provided. However, since this feature deals with real-time data display, ensuring that data handling is secure and efficient would be crucial.
    • Performance implications are not directly evident from the PR. However, rendering performance for live updates should be considered, especially how state updates are managed and rendered in the UI.
  5. Dependency Management:

    • The PR modifies dependencies by pointing to a local version of posthog-js. This is potentially risky as it relies on local changes that might not be tracked or versioned properly in production environments. It would be advisable to merge those changes into the main posthog-js repository or use a versioned package.

Recommendations

  • Testing: Ensure comprehensive testing around this new feature, particularly integration tests that can simulate real-time data flow and interaction scenarios.
  • Performance Evaluation: It would be beneficial to monitor performance impacts, especially how the UI handles frequent state updates.
  • Finalize Dependencies: Before merging, ensure that all dependencies are correctly versioned and published to avoid issues with untracked dependency versions.

Conclusion

The pull request introduces a useful feature that enhances the debugging capabilities directly from the PostHog UI. The implementation follows good coding practices with some areas for improvement around dependency management and performance evaluation. With adequate testing and final adjustments, this feature could significantly improve user experience for PostHog users engaging in real-time event monitoring and debugging.

Report On: Fetch PR 21520 For Assessment



Pull Request Analysis

Overview

The pull request in question is aimed at enhancing the HogQL feature within the PostHog platform, specifically focusing on the handling of distinct_id-based person overrides. This feature is crucial as it impacts how data is queried and managed, ensuring that user interactions and functionalities are accurately captured and processed.

Changes Introduced

  1. HogQL Query Modifier: A new modifier has been introduced, controlled by a feature flag, which allows enabling the reading from a new table (person_distinct_id_overrides) on a per-team or organization basis. This change aims to make the queries more efficient by using this new table that directly contains the necessary data for overrides.

  2. Support Across Different Modes: The PR ensures that both legacy and HogQL queries are supported across different modes as outlined in the table below:

Mode Legacy HogQL
DISABLED Yes Yes
PERSON_ID_NO_OVERRIDE_PROPERTIES_ON_EVENTS Yes Yes
PERSON_ID_OVERRIDE_PROPERTIES_ON_EVENTS person_overrides ("v2") only Yes
PERSON_ID_OVERRIDE_PROPERTIES_JOINED No Yes
  1. Testing and Validation: The changes have been tested manually via /debug, and automated tests have been added to ensure the functionality works as expected.

Code Quality Assessment

  1. Clarity and Maintainability: The code changes are well-documented with clear comments explaining the purpose of major changes. The use of descriptive variable names and structured code blocks enhances readability.

  2. Error Handling: There is no explicit error handling seen in the diffs provided for scenarios where feature flags might not work as expected or database reads might fail. It's crucial to handle such cases to avoid disruptions in production.

  3. Efficiency: The decision to use a new table for overrides seems to be driven by efficiency, reducing the complexity of queries by avoiding unnecessary joins. This should theoretically improve performance, though benchmark results or metrics would be beneficial for validation.

  4. Testing: The addition of both manual checks and automated tests is positive, showing a commitment to quality and stability. However, the scope of automated tests could be expanded to cover edge cases more comprehensively.

  5. Security and Safety: The changes do not seem to introduce any new security concerns directly. However, careful management of feature flags and access controls around the new modifiers is essential to prevent unauthorized use.

  6. Documentation: While inline comments are helpful, updating external documentation to reflect these changes and guide users on when to use these new modifiers would enhance usability and adoption.

Recommendations

  • Enhance Error Handling: Implement robust error handling around feature flag usage and database interactions.
  • Expand Testing: Increase the coverage of automated tests to include edge cases and potential failure scenarios.
  • Update Documentation: Ensure that all external documentation is updated to reflect these changes comprehensively.
  • Performance Metrics: If possible, include performance benchmarks or metrics that demonstrate the impact of these changes on query efficiency.

Overall, the pull request introduces significant improvements to how person overrides are handled in HogQL queries, with a focus on efficiency and flexibility. With some enhancements around error handling, testing, and documentation, this can be a valuable update to the PostHog platform.

Report On: Fetch Files For Assessment



Analysis of PostHog's Source Code

Overview

PostHog is an open-source analytics platform that provides a suite of tools for product analytics, including event tracking, session recording, feature flagging, and A/B testing. The platform is designed to be self-hosted, ensuring data privacy and security. The source code is primarily written in Python and TypeScript, reflecting its backend and frontend components respectively.

Source Code Files Analysis

1. DefinitionPopoverContents.tsx

Purpose: This TypeScript file is part of the frontend and manages the content displayed in a popover when users interact with definitions (like events or properties) in the UI.

Structure:

  • The file defines several React components such as VerifiedDefinitionCheckbox, DefinitionView, and DefinitionEdit which are used to render different parts of the popover based on the context (view or edit mode).
  • It uses Kea (a state management library for React) to handle logic related to state changes within the popover.
  • The file handles different types of definitions like events, actions, cohorts, etc., and displays relevant information using a consistent layout defined in DefinitionPopover.

Quality:

  • Readability: The code is well-organized with clear separation of components and extensive use of descriptive variable names.
  • Maintainability: The use of Kea logic makes the state management predictable and centralized but could increase complexity for new developers not familiar with Kea.
  • Reusability: Components are modular but are tightly coupled with the specific logic for handling definitions, which might limit reusability in other contexts.

2. database.py

Purpose: This Python file is part of the backend, specifically within the GraphQL API layer (hogql), managing database schema definitions and interactions.

Structure:

  • Defines a Database class that encapsulates various tables and their configurations.
  • Uses Pydantic for data validation and settings management through the BaseModel class.
  • Includes functions to dynamically adjust database schemas based on different modes (e.g., handling person properties directly on events).

Quality:

  • Readability: The code is complex due to dynamic schema modifications and various conditional checks based on configuration.
  • Maintainability: High due to clear separation between schema definition and business logic. However, the dynamic nature of schema adjustments could lead to potential bugs if not well-documented.
  • Reusability: The design promotes reusability through modular table definitions but requires deep understanding of the underlying modifications for new use cases.

3. test_session_recording_list_from_session_replay.py

Purpose: This Python file contains tests for session recording queries, ensuring that session replay data is correctly retrieved and filtered.

Structure:

  • Uses parameterized tests to cover various scenarios and configurations.
  • Mocks external dependencies and uses fixtures for setting up test data.
  • Tests are focused on validating the correctness of SQL queries generated by the session recording logic.

Quality:

  • Readability: Good readability with clear test case descriptions and structured assertions.
  • Maintainability: High, as tests are isolated and do not depend on external state.
  • Reusability: Test utilities and setups can be reused for similar testing scenarios within session recordings or other query-related tests.

Conclusion

The examined files from PostHog's repository demonstrate a high standard of code quality with good practices in modularity, readability, and maintainability. However, there are areas where complexity could be reduced, particularly in dynamic schema configurations in the backend. Overall, PostHog's source code reflects its robustness and scalability as an analytics platform.