Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled
One row per proxied upstream attempt (pcat call/capture/validate, emex http) written fire-and-forget by the new ProxyTelemetryService (buffered, capped, errors swallowed — telemetry can never hurt the request path). - banned = upstream 403/429 (IP-block signal), distinct from auth/data errors - sticky legs (pcat capture, emex floxy) carry a session_key; pcat capture also resolves the actual residential exit IP via a parallel ipify probe through the same sticky session → concrete banned-IP tracking - rotating legs log provider + outcome (ban *rate* instead of per-IP) - 30-day retention piggybacked on the query-cleanup job Feeds the Süper Panel /analytics/proxy page (provider grading + banned IPs). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
24 lines
1.0 KiB
SQL
24 lines
1.0 KiB
SQL
-- Proxy telemetry: one row per proxied upstream attempt (pcat call/capture/
|
|
-- validate, emex http). Lets the Süper Panel grade proxy providers per service
|
|
-- (success rate, ban rate, latency) and track banned residential exit IPs /
|
|
-- sticky sessions. Written fire-and-forget by ProxyTelemetryService; 30-day
|
|
-- retention enforced by the query-cleanup job.
|
|
CREATE TABLE "proxy_logs" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
"service" varchar(30) NOT NULL,
|
|
"provider" varchar(20) NOT NULL,
|
|
"session_key" varchar(60),
|
|
"exit_ip" varchar(45),
|
|
"target_host" varchar(120),
|
|
"status_code" integer,
|
|
"error_kind" varchar(30),
|
|
"success" boolean DEFAULT false NOT NULL,
|
|
"banned" boolean DEFAULT false NOT NULL,
|
|
"duration_ms" integer,
|
|
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE INDEX "proxy_logs_created_at_idx" ON "proxy_logs" ("created_at");
|
|
--> statement-breakpoint
|
|
CREATE INDEX "proxy_logs_banned_created_at_idx" ON "proxy_logs" ("banned","created_at");
|