PostHog / PostHog/posthog

Downstream Lineage for Models

Open
#66,069 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
6h 51m
Merged PRs (30d)
232

Description

Feature request

Is your feature request related to a problem?

There is a lack of visibility of what is effected if I change a Model (View).

Describe the solution you'd like

The Lineage feature is amazing. However, it only shows upstream dependencies. It would be amazing to show its downstream dependencies as well. Ideally, this would be everywhere within the app. Off the top of my head, that would be:

  1. In other Views
  2. In Insights
  3. In Notebooks

Also, it would be great if this would optionally show nested downstream dependencies. For example, if a View is used in an Insight and that Insight is used in a Dashboard, the user would be able to see the chain from View -> Insight -> Dashboard. (This would require Lineage being available for Insights as requested in #66075)

Describe alternatives you've considered

I currently use the query below to search through Views, Insights, and Notebooks for the name of a view (but can be any search term).

WITH 
    'EXAMPLE' AS search_term

-- Views containing the view
SELECT  
    'View'                    AS container_type,
    name                      AS container_name,
    toString(id)              AS container_id
FROM system.data_modeling_views  
WHERE deleted = 0  
  AND toString(query) ILIKE concat('%', search_term, '%')

UNION ALL

-- Insights containing the view
SELECT  
    'Insight'                 AS container_type,
    name                      AS container_name,
    short_id                  AS container_id
FROM system.insights  
WHERE deleted = 0  
  AND toString(query) ILIKE concat('%', search_term, '%')

UNION ALL

-- Notebooks containing the view
SELECT
    'Notebook'                AS container_type,
    title                     AS container_name,
    short_id                  AS container_id
FROM system.notebooks  
WHERE deleted = 0  
  AND toString(content) ILIKE concat('%', search_term, '%')

ORDER BY container_type, container_name
LIMIT 500
Debug info
- [ ] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are identified. Start by tracing the existing upstream Lineage entry point across Views, Insights, and Notebooks, using the referenced system.data_modeling_views, system.insights, and system.notebooks records as context. Done would include downstream dependencies and, where supported, nested chains such as View → Insight → Dashboard.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
analytics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.