ad4fcd1cfd
First-party plugins for Fabled Scryer (https://github.com/bvandeusen/fabledscryer). traefik: Prometheus metrics scraping, stats history, access log parsing (GeoIP optional) unifi: UniFi controller integration — WAN health, devices, clients, DPI, events ups: UPS monitoring via NUT (Network UPS Tools), Ansible shutdown automation Each plugin follows the Fabled Scryer plugin contract: setup(app), get_scheduled_tasks(), get_blueprint() index.yaml lists all three plugins in the catalog format. Populate checksum_sha256 entries once release zips are published via GitHub Releases. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
38 lines
1.4 KiB
Python
38 lines
1.4 KiB
Python
# plugins/traefik/migrations/versions/traefik_001_initial.py
|
|
"""Traefik metrics table
|
|
|
|
Revision ID: traefik_001_initial
|
|
Revises: (none — this is a branch off the core head via depends_on)
|
|
Create Date: 2026-03-17
|
|
"""
|
|
from typing import Sequence, Union
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
revision: str = "traefik_001_initial"
|
|
down_revision: Union[str, None] = None
|
|
branch_labels: Union[str, Sequence[str], None] = "traefik"
|
|
depends_on: Union[str, Sequence[str], None] = ("0004_app_settings",)
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.create_table(
|
|
"traefik_metrics",
|
|
sa.Column("id", sa.String(36), primary_key=True),
|
|
sa.Column("router_name", sa.String(255), nullable=False),
|
|
sa.Column("scraped_at", sa.DateTime(timezone=True), nullable=False),
|
|
sa.Column("request_rate", sa.Float, nullable=False),
|
|
sa.Column("error_rate_4xx_pct", sa.Float, nullable=False),
|
|
sa.Column("error_rate_5xx_pct", sa.Float, nullable=False),
|
|
sa.Column("latency_p50_ms", sa.Float, nullable=False),
|
|
sa.Column("latency_p95_ms", sa.Float, nullable=False),
|
|
sa.Column("latency_p99_ms", sa.Float, nullable=False),
|
|
)
|
|
op.create_index("ix_traefik_metrics_router_scraped", "traefik_metrics",
|
|
["router_name", "scraped_at"])
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_index("ix_traefik_metrics_router_scraped", "traefik_metrics")
|
|
op.drop_table("traefik_metrics")
|