feat(proxy): proxy_logs telemetry — per-attempt provider/ban/latency tracking
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>
This commit is contained in:
2026-06-11 17:27:48 +03:00
parent 9f47d15312
commit 45f7e3f5a4
12 changed files with 373 additions and 9 deletions

View File

@@ -0,0 +1,10 @@
import { Module } from "@nestjs/common";
import { ProxyTelemetryService } from "./proxy-telemetry.service";
// Imported by PartsCatalogsModule and EmexModule; Nest module caching makes the
// service a singleton (one shared flush buffer) across both.
@Module({
providers: [ProxyTelemetryService],
exports: [ProxyTelemetryService],
})
export class ProxyTelemetryModule {}