Currently when a plugin errors, it gets autodisabled. This is however completely silent and easy to miss. The result can be degraded data quality or a hole in data in case of export plugins – something to be fixed ASAP.

A PagerDuty integration could come in useful here, allowing an alert to be sent in case of a plugin getting disabled. PagerDuty is tailored for this kind of thing, so this would potentially be better than e.g. an email – that could be easily missed in a sea of emails.

This problem was brought up by a current user of our Snowflake Export Plugin.
posthog/models/plugin.py
import datetime
import os
from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, List, Optional, cast
from uuid import UUID
from django.conf import settings
from django.db import models
from django.db.models.signals import post_delete, post_save
from django.dispatch.dispatcher import receiver
from django.utils import timezone
from rest_framework.exceptions import ValidationError
from semantic_version.base import SimpleSpec, Version
from posthog.models.organization import Organization
from posthog.models.signals import mutable_receiver
from posthog.models.team import Team
from posthog.plugins.access import can_configure_plugins, can_install_plugins
from posthog.plugins.reload import reload_plugins_on_workers
from posthog.plugins.utils import download_plugin_archive, get_json_from_archive, load_json_file, parse_url
from posthog.version import VERSION
from .utils import UUIDModel, sane_repr
try:
    from posthog.client import sync_execute
except ImportError:
    pass
def raise_if_plugin_installed(url: str, organization_id: str):