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
class Meta:
        constraints = [
            models.UniqueConstraint(name="unique_filename_for_plugin", fields=("plugin_id", "filename")),
        ]
    class Status(models.TextChoices):
        LOCKED = "LOCKED", "locked"
        TRANSPILED = "TRANSPILED", "transpiled"
        ERROR = "ERROR", "error"
    plugin: models.ForeignKey = models.ForeignKey("Plugin", on_delete=models.CASCADE)
    filename: models.CharField = models.CharField(max_length=200, blank=False)
    
    source: models.TextField = models.TextField(blank=True, null=True)
    status: models.CharField = models.CharField(max_length=20, choices=Status.choices, null=True)
    transpiled: models.TextField = models.TextField(blank=True, null=True)
    error: models.TextField = models.TextField(blank=True, null=True)
    __repr__ = sane_repr("plugin_id", "filename", "status")
@dataclass(frozen=True)
class PluginLogEntry:
    id: UUID
    team_id: int
    plugin_id: int
    plugin_config_id: int
    timestamp: datetime.datetime
    source: PluginLogEntrySource
    type: PluginLogEntryType
    message: str
    instance_id: UUID
def fetch_plugin_log_entries(