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.3 KB
Raw Blame
from products.warehouse_sources.sources.sdk import IncrementalField, IncrementalFieldType, frozen


@frozen
class ThousandeyesEndpoint:
    path: str
    selector: str
    primary_keys: tuple[str, ...]
    alert_state: str | None = None


ENDPOINTS = {
    "tests": ThousandeyesEndpoint(path="tests", selector="tests", primary_keys=("testId",)),
    "agents": ThousandeyesEndpoint(path="agents", selector="agents", primary_keys=("agentId",)),
    "alert_rules": ThousandeyesEndpoint(path="alerts/rules", selector="alertRules", primary_keys=("ruleId",)),
    "active_alerts": ThousandeyesEndpoint(
        path="alerts", selector="alerts", primary_keys=("id",), alert_state="trigger"
    ),
    "cleared_alerts": ThousandeyesEndpoint(path="alerts", selector="alerts", primary_keys=("id",), alert_state="clear"),
    "http_server_results": ThousandeyesEndpoint(
        path="test-results/{testId}/http-server", selector="results", primary_keys=("testId", "agentId", "roundId")
    ),
}

INCREMENTAL_FIELDS: dict[str, list[IncrementalField]] = {
    "http_server_results": [
        IncrementalField(
            label="date",
            type=IncrementalFieldType.DateTime,
            field="date",
            field_type=IncrementalFieldType.DateTime,
        )
    ]
}
HISTORY_DAYS = 30