Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

1.1 KB
Raw Blame
from products.pulse.backend.sources.anchored_dashboards import AnchoredDashboardsSource
from products.pulse.backend.sources.anchored_insights import AnchoredInsightsSource
from products.pulse.backend.sources.annotations import AnnotationsSource
from products.pulse.backend.sources.base import BriefSource
from products.pulse.backend.sources.resource_health import ResourceHealthSource
from products.pulse.backend.sources.strategy import MovementScoringStrategy

# Both anchored sources share one scoring strategy: retrieval (which insights) differs, scoring
# is identical. Mutable registry so new sources can be registered (tests, future products)
# without editing the gather path. `get_sources` returns a copy so callers can't mutate in place.
_strategy = MovementScoringStrategy()
_sources: list[BriefSource] = [
    AnchoredInsightsSource(_strategy),
    AnchoredDashboardsSource(_strategy),
    AnnotationsSource(),
    ResourceHealthSource(),
]


def get_sources() -> list[BriefSource]:
    return list(_sources)


def register_source(source: BriefSource) -> None:
    _sources.append(source)