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.

793 B
Raw Blame
"""Django app configuration for metrics."""

from django.apps import AppConfig


class MetricsConfig(AppConfig):
    default_auto_field = "django.db.models.BigAutoField"
    name = "products.metrics.backend"
    label = "metrics"

    def ready(self) -> None:
        from products.metrics.backend.dashboard_import import receivers  # noqa: PLC0415 — needs the app registry

        receivers.connect()

        # The alerts platform imports no source, so metrics alerts register their wording and their
        # `source_config` schema with it here, in every process.
        from products.metrics.backend.alerts.registration import register  # noqa: PLC0415

        register()

        from products.metrics.backend import task_profiles  # noqa: PLC0415

        task_profiles.register()