[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"blog-post-en-monitoring-proxy-performance":3},{"success":4,"payload":5,"related":78,"errors":150},true,{"id":6,"slug":7,"title":8,"excerpt":9,"body_html":10,"meta_title":11,"meta_description":12,"canonical_url":13,"canonical_override":14,"og_title":8,"og_description":12,"og_image_url":15,"faq_json":16,"key_takeaways":32,"allow_index":37,"noindex_google_only":37,"allow_follow":4,"published_at":38,"updated_at":39,"content_updated_at":40,"featured_image_url":41,"featured_image_alt":14,"card_image_url":42,"reading_time_minutes":43,"author":44,"categories":48,"tags":55,"alternates":64,"locale_paths":76,"views":77},41,"monitoring-proxy-performance","Monitoring Proxy Performance: Latency, Success Rate, and Alerts","Learn how to instrument, monitor, and alert on proxy performance — track latency percentiles, success rates, error patterns, and bandwidth. Code examples in Python, Node.js, and Go.","\u003Ch2>Why Monitor Proxy Performance\u003C\u002Fh2>\n\u003Cp>Proxy infrastructure fails silently. Your scraper might run for hours with a 40% success rate before anyone notices. Response times creep up, block rates increase, and data quality degrades — all without triggering obvious errors. Monitoring turns these invisible problems into actionable alerts.\u003C\u002Fp>\n\u003Cp>This guide shows you how to instrument your proxy requests, collect meaningful metrics, build dashboards, and set up alerting that catches degradation before it impacts your data pipeline. All examples use \u003Ca href=\"\u002Fblog\u002Fbest-proxies-for-web-scraping-2026\">ProxyHat's residential proxies\u003C\u002Fa> and are production-ready.\u003C\u002Fp>\n\u003Cblockquote>If you are not measuring your proxy performance, you are guessing. Guessing at scale costs money and produces unreliable data.\u003C\u002Fblockquote>\n\u003Ch2>Key Metrics to Track\u003C\u002Fh2>\n\u003Ctable>\n\u003Ccaption>Key Metrics to Track\u003C\u002Fcaption>\n\u003Cthead>\n\u003Ctr>\u003Cth>Metric\u003C\u002Fth>\u003Cth>What It Tells You\u003C\u002Fth>\u003Cth>Alert Threshold\u003C\u002Fth>\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>Success Rate\u003C\u002Ftd>\u003Ctd>Percentage of requests returning 2xx status\u003C\u002Ftd>\u003Ctd>Below 90%\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Response Latency (p50\u002Fp95\u002Fp99)\u003C\u002Ftd>\u003Ctd>How fast proxied requests complete\u003C\u002Ftd>\u003Ctd>p95 above 10s\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Error Rate by Type\u003C\u002Ftd>\u003Ctd>Which errors dominate (timeout, 403, 429, connection)\u003C\u002Ftd>\u003Ctd>Any single type above 15%\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Requests per Second\u003C\u002Ftd>\u003Ctd>Throughput of your scraping pipeline\u003C\u002Ftd>\u003Ctd>Below expected baseline\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Bandwidth Usage\u003C\u002Ftd>\u003Ctd>Data transferred through proxy\u003C\u002Ftd>\u003Ctd>Approaching plan limit\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Block Rate by Target\u003C\u002Ftd>\u003Ctd>Which targets block you most\u003C\u002Ftd>\u003Ctd>Above 20% for any target\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Retry Rate\u003C\u002Ftd>\u003Ctd>How many requests need retries\u003C\u002Ftd>\u003Ctd>Above 30%\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Session Reuse Efficiency\u003C\u002Ftd>\u003Ctd>How long sticky sessions survive\u003C\u002Ftd>\u003Ctd>Below 5 requests average\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Ch2>Python: Instrumented Proxy Client\u003C\u002Fh2>\n\u003Cp>This client wraps every request with timing, status tracking, and structured logging.\u003C\u002Fp>\n\u003Cpre>\u003Ccode>import time\nimport uuid\nimport logging\nimport statistics\nfrom dataclasses import dataclass, field\nfrom collections import defaultdict\nfrom typing import Optional\nimport requests\nlogger = logging.getLogger(\"proxy_monitor\")\n@dataclass\nclass ProxyMetrics:\n    \"\"\"Collects and aggregates proxy performance metrics.\"\"\"\n    total_requests: int = 0\n    successful: int = 0\n    failed: int = 0\n    retries: int = 0\n    latencies: list = field(default_factory=list)\n    status_codes: dict = field(default_factory=lambda: defaultdict(int))\n    errors_by_type: dict = field(default_factory=lambda: defaultdict(int))\n    bytes_transferred: int = 0\n    requests_by_target: dict = field(default_factory=lambda: defaultdict(lambda: {\"success\": 0, \"failed\": 0}))\n    @property\n    def success_rate(self) -> float:\n        return (self.successful \u002F self.total_requests * 100) if self.total_requests > 0 else 0.0\n    @property\n    def p50_latency(self) -> float:\n        return statistics.median(self.latencies) if self.latencies else 0.0\n    @property\n    def p95_latency(self) -> float:\n        if not self.latencies:\n            return 0.0\n        sorted_lat = sorted(self.latencies)\n        idx = int(len(sorted_lat) * 0.95)\n        return sorted_lat[min(idx, len(sorted_lat) - 1)]\n    @property\n    def p99_latency(self) -> float:\n        if not self.latencies:\n            return 0.0\n        sorted_lat = sorted(self.latencies)\n        idx = int(len(sorted_lat) * 0.99)\n        return sorted_lat[min(idx, len(sorted_lat) - 1)]\n    def summary(self) -> dict:\n        return {\n            \"total_requests\": self.total_requests,\n            \"success_rate\": f\"{self.success_rate:.1f}%\",\n            \"p50_latency\": f\"{self.p50_latency:.3f}s\",\n            \"p95_latency\": f\"{self.p95_latency:.3f}s\",\n            \"p99_latency\": f\"{self.p99_latency:.3f}s\",\n            \"retries\": self.retries,\n            \"bytes_transferred\": self.bytes_transferred,\n            \"top_errors\": dict(sorted(\n                self.errors_by_type.items(),\n                key=lambda x: x[1], reverse=True\n            )[:5]),\n            \"status_distribution\": dict(self.status_codes),\n        }\nclass MonitoredProxyClient:\n    \"\"\"HTTP client with built-in proxy monitoring.\"\"\"\n    def __init__(self, max_retries: int = 3):\n        self.metrics = ProxyMetrics()\n        self.max_retries = max_retries\n        self._alert_callbacks = []\n    def on_alert(self, callback):\n        \"\"\"Register a callback for metric alerts.\"\"\"\n        self._alert_callbacks.append(callback)\n    def _check_alerts(self):\n        if self.metrics.total_requests \u003C 10:\n            return\n        alerts = []\n        if self.metrics.success_rate \u003C 90:\n            alerts.append(f\"Low success rate: {self.metrics.success_rate:.1f}%\")\n        if self.metrics.p95_latency > 10:\n            alerts.append(f\"High p95 latency: {self.metrics.p95_latency:.1f}s\")\n        if self.metrics.retries \u002F max(self.metrics.total_requests, 1) > 0.3:\n            alerts.append(f\"High retry rate: {self.metrics.retries}\u002F{self.metrics.total_requests}\")\n        for alert in alerts:\n            logger.warning(f\"ALERT: {alert}\")\n            for cb in self._alert_callbacks:\n                cb(alert)\n    def fetch(self, url: str, country: Optional[str] = None) -> Optional[requests.Response]:\n        from urllib.parse import urlparse\n        target_domain = urlparse(url).netloc\n        for attempt in range(self.max_retries + 1):\n            session_id = uuid.uuid4().hex[:8]\n            username = f\"USERNAME-sid-{session_id}\"\n            if country:\n                username += f\"-country-{country}\"\n            proxy = f\"http:\u002F\u002F{username}:PASSWORD@gate.proxyhat.com:8080\"\n            self.metrics.total_requests += 1\n            if attempt > 0:\n                self.metrics.retries += 1\n            start = time.time()\n            try:\n                response = requests.get(\n                    url,\n                    proxies={\"http\": proxy, \"https\": proxy},\n                    timeout=30,\n                )\n                latency = time.time() - start\n                self.metrics.latencies.append(latency)\n                self.metrics.status_codes[response.status_code] += 1\n                if response.status_code >= 400:\n                    self.metrics.errors_by_type[f\"HTTP_{response.status_code}\"] += 1\n                    self.metrics.requests_by_target[target_domain][\"failed\"] += 1\n                    if response.status_code in (403, 429, 503) and attempt \u003C self.max_retries:\n                        time.sleep(2 ** attempt)\n                        continue\n                    self.metrics.failed += 1\n                else:\n                    self.metrics.successful += 1\n                    self.metrics.bytes_transferred += len(response.content)\n                    self.metrics.requests_by_target[target_domain][\"success\"] += 1\n                self._check_alerts()\n                return response\n            except requests.exceptions.Timeout:\n                self.metrics.errors_by_type[\"timeout\"] += 1\n                self.metrics.latencies.append(time.time() - start)\n                self.metrics.requests_by_target[target_domain][\"failed\"] += 1\n            except requests.exceptions.ConnectionError:\n                self.metrics.errors_by_type[\"connection_error\"] += 1\n                self.metrics.latencies.append(time.time() - start)\n                self.metrics.requests_by_target[target_domain][\"failed\"] += 1\n            except Exception as e:\n                self.metrics.errors_by_type[type(e).__name__] += 1\n                self.metrics.latencies.append(time.time() - start)\n            if attempt \u003C self.max_retries:\n                time.sleep(2 ** attempt)\n        self.metrics.failed += 1\n        self._check_alerts()\n        return None\n# Usage\nclient = MonitoredProxyClient(max_retries=3)\nclient.on_alert(lambda msg: print(f\"[ALERT] {msg}\"))\nurls = [f\"https:\u002F\u002Fexample.com\u002Fproduct\u002F{i}\" for i in range(100)]\nfor url in urls:\n    response = client.fetch(url)\nprint(client.metrics.summary())\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>Node.js: Instrumented Proxy Client\u003C\u002Fh2>\n\u003Cpre>\u003Ccode>const crypto = require('crypto');\nconst { HttpsProxyAgent } = require('https-proxy-agent');\nconst { EventEmitter } = require('events');\nclass ProxyMetrics {\n  constructor() {\n    this.totalRequests = 0;\n    this.successful = 0;\n    this.failed = 0;\n    this.retries = 0;\n    this.latencies = [];\n    this.statusCodes = {};\n    this.errorsByType = {};\n    this.bytesTransferred = 0;\n    this.requestsByTarget = {};\n  }\n  get successRate() {\n    return this.totalRequests > 0\n      ? ((this.successful \u002F this.totalRequests) * 100).toFixed(1)\n      : '0.0';\n  }\n  percentile(p) {\n    if (this.latencies.length === 0) return 0;\n    const sorted = [...this.latencies].sort((a, b) => a - b);\n    const idx = Math.min(\n      Math.floor(sorted.length * (p \u002F 100)),\n      sorted.length - 1\n    );\n    return sorted[idx];\n  }\n  summary() {\n    return {\n      totalRequests: this.totalRequests,\n      successRate: `${this.successRate}%`,\n      p50Latency: `${this.percentile(50).toFixed(3)}s`,\n      p95Latency: `${this.percentile(95).toFixed(3)}s`,\n      p99Latency: `${this.percentile(99).toFixed(3)}s`,\n      retries: this.retries,\n      bytesTransferred: this.bytesTransferred,\n      statusDistribution: { ...this.statusCodes },\n      topErrors: Object.entries(this.errorsByType)\n        .sort(([, a], [, b]) => b - a)\n        .slice(0, 5)\n        .reduce((obj, [k, v]) => ({ ...obj, [k]: v }), {}),\n    };\n  }\n}\nclass MonitoredProxyClient extends EventEmitter {\n  constructor({ maxRetries = 3 } = {}) {\n    super();\n    this.metrics = new ProxyMetrics();\n    this.maxRetries = maxRetries;\n  }\n  _checkAlerts() {\n    if (this.metrics.totalRequests \u003C 10) return;\n    if (parseFloat(this.metrics.successRate) \u003C 90) {\n      this.emit('alert', `Low success rate: ${this.metrics.successRate}%`);\n    }\n    if (this.metrics.percentile(95) > 10) {\n      this.emit('alert', `High p95 latency: ${this.metrics.percentile(95).toFixed(1)}s`);\n    }\n  }\n  async fetch(url, { country } = {}) {\n    const targetDomain = new URL(url).hostname;\n    for (let attempt = 0; attempt \u003C= this.maxRetries; attempt++) {\n      const sessionId = crypto.randomBytes(4).toString('hex');\n      let username = `USERNAME-sid-${sessionId}`;\n      if (country) username += `-country-${country}`;\n      const agent = new HttpsProxyAgent(\n        `http:\u002F\u002F${username}:PASSWORD@gate.proxyhat.com:8080`\n      );\n      this.metrics.totalRequests++;\n      if (attempt > 0) this.metrics.retries++;\n      const startTime = Date.now();\n      try {\n        const response = await fetch(url, {\n          agent,\n          signal: AbortSignal.timeout(30000),\n        });\n        const latency = (Date.now() - startTime) \u002F 1000;\n        this.metrics.latencies.push(latency);\n        this.metrics.statusCodes[response.status] =\n          (this.metrics.statusCodes[response.status] || 0) + 1;\n        if (response.status >= 400) {\n          this.metrics.errorsByType[`HTTP_${response.status}`] =\n            (this.metrics.errorsByType[`HTTP_${response.status}`] || 0) + 1;\n          if ([403, 429, 503].includes(response.status) && attempt \u003C this.maxRetries) {\n            await new Promise(r => setTimeout(r, 1000 * Math.pow(2, attempt)));\n            continue;\n          }\n          this.metrics.failed++;\n        } else {\n          this.metrics.successful++;\n          const body = await response.text();\n          this.metrics.bytesTransferred += body.length;\n        }\n        this._checkAlerts();\n        return response;\n      } catch (err) {\n        const latency = (Date.now() - startTime) \u002F 1000;\n        this.metrics.latencies.push(latency);\n        this.metrics.errorsByType[err.name] =\n          (this.metrics.errorsByType[err.name] || 0) + 1;\n        if (attempt \u003C this.maxRetries) {\n          await new Promise(r => setTimeout(r, 1000 * Math.pow(2, attempt)));\n          continue;\n        }\n        this.metrics.failed++;\n      }\n    }\n    this._checkAlerts();\n    return null;\n  }\n}\n\u002F\u002F Usage\nconst client = new MonitoredProxyClient({ maxRetries: 3 });\nclient.on('alert', msg => console.warn(`[ALERT] ${msg}`));\nconst urls = Array.from({ length: 100 }, (_, i) =>\n  `https:\u002F\u002Fexample.com\u002Fproduct\u002F${i + 1}`\n);\nfor (const url of urls) {\n  await client.fetch(url);\n}\nconsole.log(client.metrics.summary());\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>Go: Instrumented Proxy Client\u003C\u002Fh2>\n\u003Cpre>\u003Ccode>package main\nimport (\n\t\"crypto\u002Frand\"\n\t\"encoding\u002Fhex\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"net\u002Fhttp\"\n\t\"net\u002Furl\"\n\t\"sort\"\n\t\"sync\"\n\t\"time\"\n)\ntype Metrics struct {\n\tmu             sync.Mutex\n\tTotalRequests  int\n\tSuccessful     int\n\tFailed         int\n\tRetries        int\n\tLatencies      []float64\n\tStatusCodes    map[int]int\n\tErrorsByType   map[string]int\n\tBytesTransferred int64\n}\nfunc NewMetrics() *Metrics {\n\treturn &Metrics{\n\t\tStatusCodes:  make(map[int]int),\n\t\tErrorsByType: make(map[string]int),\n\t}\n}\nfunc (m *Metrics) RecordSuccess(latency float64, status int, bytes int) {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\tm.TotalRequests++\n\tm.Successful++\n\tm.Latencies = append(m.Latencies, latency)\n\tm.StatusCodes[status]++\n\tm.BytesTransferred += int64(bytes)\n}\nfunc (m *Metrics) RecordFailure(latency float64, errType string) {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\tm.TotalRequests++\n\tm.Failed++\n\tm.Latencies = append(m.Latencies, latency)\n\tm.ErrorsByType[errType]++\n}\nfunc (m *Metrics) Percentile(p float64) float64 {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\tif len(m.Latencies) == 0 {\n\t\treturn 0\n\t}\n\tsorted := make([]float64, len(m.Latencies))\n\tcopy(sorted, m.Latencies)\n\tsort.Float64s(sorted)\n\tidx := int(math.Min(float64(len(sorted)-1), float64(len(sorted))*p\u002F100))\n\treturn sorted[idx]\n}\nfunc (m *Metrics) SuccessRate() float64 {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\tif m.TotalRequests == 0 {\n\t\treturn 0\n\t}\n\treturn float64(m.Successful) \u002F float64(m.TotalRequests) * 100\n}\nfunc (m *Metrics) Summary() string {\n\treturn fmt.Sprintf(\n\t\t\"Requests: %d | Success: %.1f%% | p50: %.3fs | p95: %.3fs | p99: %.3fs | Retries: %d\",\n\t\tm.TotalRequests, m.SuccessRate(),\n\t\tm.Percentile(50), m.Percentile(95), m.Percentile(99),\n\t\tm.Retries,\n\t)\n}\ntype MonitoredClient struct {\n\tmetrics    *Metrics\n\tmaxRetries int\n}\nfunc NewMonitoredClient(maxRetries int) *MonitoredClient {\n\treturn &MonitoredClient{\n\t\tmetrics:    NewMetrics(),\n\t\tmaxRetries: maxRetries,\n\t}\n}\nfunc (c *MonitoredClient) Fetch(target string) (*http.Response, error) {\n\tfor attempt := 0; attempt \u003C= c.maxRetries; attempt++ {\n\t\tb := make([]byte, 4)\n\t\trand.Read(b)\n\t\tsessionID := hex.EncodeToString(b)\n\t\tproxyStr := fmt.Sprintf(\n\t\t\t\"http:\u002F\u002FUSERNAME-sid-%s:PASSWORD@gate.proxyhat.com:8080\",\n\t\t\tsessionID,\n\t\t)\n\t\tproxyURL, _ := url.Parse(proxyStr)\n\t\tclient := &http.Client{\n\t\t\tTransport: &http.Transport{Proxy: http.ProxyURL(proxyURL)},\n\t\t\tTimeout:   30 * time.Second,\n\t\t}\n\t\tif attempt > 0 {\n\t\t\tc.metrics.mu.Lock()\n\t\t\tc.metrics.Retries++\n\t\t\tc.metrics.mu.Unlock()\n\t\t}\n\t\tstart := time.Now()\n\t\tresp, err := client.Get(target)\n\t\tlatency := time.Since(start).Seconds()\n\t\tif err != nil {\n\t\t\tc.metrics.RecordFailure(latency, \"connection_error\")\n\t\t\tif attempt \u003C c.maxRetries {\n\t\t\t\ttime.Sleep(time.Duration(math.Pow(2, float64(attempt))) * time.Second)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\tbody, _ := io.ReadAll(resp.Body)\n\t\tresp.Body.Close()\n\t\tif resp.StatusCode >= 400 {\n\t\t\tc.metrics.RecordFailure(latency, fmt.Sprintf(\"HTTP_%d\", resp.StatusCode))\n\t\t\tif attempt \u003C c.maxRetries {\n\t\t\t\ttime.Sleep(time.Duration(math.Pow(2, float64(attempt))) * time.Second)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t} else {\n\t\t\tc.metrics.RecordSuccess(latency, resp.StatusCode, len(body))\n\t\t}\n\t\treturn resp, nil\n\t}\n\treturn nil, fmt.Errorf(\"all retries exhausted for %s\", target)\n}\nfunc main() {\n\tclient := NewMonitoredClient(3)\n\tfor i := 0; i \u003C 50; i++ {\n\t\turl := fmt.Sprintf(\"https:\u002F\u002Fexample.com\u002Fproduct\u002F%d\", i+1)\n\t\tclient.Fetch(url)\n\t}\n\tfmt.Println(client.metrics.Summary())\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>Structured Logging for Proxy Requests\u003C\u002Fh2>\n\u003Cp>JSON-structured logs make it easy to aggregate and analyze proxy performance across distributed scrapers.\u003C\u002Fp>\n\u003Cpre>\u003Ccode>import json\nimport logging\nimport time\nimport uuid\nimport requests\nclass JSONProxyLogger:\n    \"\"\"Logs every proxy request as structured JSON.\"\"\"\n    def __init__(self, log_file: str = \"proxy_requests.jsonl\"):\n        self.logger = logging.getLogger(\"proxy_json\")\n        handler = logging.FileHandler(log_file)\n        handler.setFormatter(logging.Formatter(\"%(message)s\"))\n        self.logger.addHandler(handler)\n        self.logger.setLevel(logging.INFO)\n    def log_request(self, entry: dict):\n        self.logger.info(json.dumps(entry))\n    def fetch(self, url: str, country: str = None) -> requests.Response:\n        session_id = uuid.uuid4().hex[:8]\n        username = f\"USERNAME-sid-{session_id}\"\n        if country:\n            username += f\"-country-{country}\"\n        proxy = f\"http:\u002F\u002F{username}:PASSWORD@gate.proxyhat.com:8080\"\n        start = time.time()\n        try:\n            response = requests.get(\n                url,\n                proxies={\"http\": proxy, \"https\": proxy},\n                timeout=30,\n            )\n            latency = time.time() - start\n            self.log_request({\n                \"timestamp\": time.strftime(\"%Y-%m-%dT%H:%M:%SZ\", time.gmtime()),\n                \"url\": url,\n                \"status\": response.status_code,\n                \"latency_ms\": round(latency * 1000),\n                \"bytes\": len(response.content),\n                \"session_id\": session_id,\n                \"country\": country,\n                \"success\": response.status_code \u003C 400,\n            })\n            return response\n        except Exception as e:\n            latency = time.time() - start\n            self.log_request({\n                \"timestamp\": time.strftime(\"%Y-%m-%dT%H:%M:%SZ\", time.gmtime()),\n                \"url\": url,\n                \"error\": str(e),\n                \"error_type\": type(e).__name__,\n                \"latency_ms\": round(latency * 1000),\n                \"session_id\": session_id,\n                \"country\": country,\n                \"success\": False,\n            })\n            raise\n# Usage — logs produce JSONL like:\n# {\"timestamp\":\"2026-02-26T10:30:00Z\",\"url\":\"https:\u002F\u002F...\",\"status\":200,\"latency_ms\":1234,...}\nproxy_logger = JSONProxyLogger(\"proxy_requests.jsonl\")\nresponse = proxy_logger.fetch(\"https:\u002F\u002Fexample.com\u002Fdata\", country=\"us\")\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>Periodic Health Reports\u003C\u002Fh2>\n\u003Cp>For long-running scrapers, generate periodic health reports that summarize performance over fixed windows.\u003C\u002Fp>\n\u003Cpre>\u003Ccode>import time\nimport threading\nfrom datetime import datetime\nclass PeriodicReporter:\n    \"\"\"Generates periodic performance reports from proxy metrics.\"\"\"\n    def __init__(self, metrics: ProxyMetrics, interval_seconds: int = 60):\n        self.metrics = metrics\n        self.interval = interval_seconds\n        self._running = False\n        self._thread = None\n        self._last_snapshot = None\n    def start(self):\n        self._running = True\n        self._last_snapshot = self._snapshot()\n        self._thread = threading.Thread(target=self._report_loop, daemon=True)\n        self._thread.start()\n    def stop(self):\n        self._running = False\n    def _snapshot(self) -> dict:\n        return {\n            \"total\": self.metrics.total_requests,\n            \"success\": self.metrics.successful,\n            \"failed\": self.metrics.failed,\n            \"retries\": self.metrics.retries,\n            \"time\": time.time(),\n        }\n    def _report_loop(self):\n        while self._running:\n            time.sleep(self.interval)\n            current = self._snapshot()\n            prev = self._last_snapshot\n            elapsed = current[\"time\"] - prev[\"time\"]\n            requests_delta = current[\"total\"] - prev[\"total\"]\n            success_delta = current[\"success\"] - prev[\"success\"]\n            failed_delta = current[\"failed\"] - prev[\"failed\"]\n            rps = requests_delta \u002F elapsed if elapsed > 0 else 0\n            window_success_rate = (\n                (success_delta \u002F requests_delta * 100)\n                if requests_delta > 0 else 0\n            )\n            report = {\n                \"window\": f\"{self.interval}s\",\n                \"timestamp\": datetime.utcnow().isoformat(),\n                \"requests\": requests_delta,\n                \"rps\": round(rps, 1),\n                \"success_rate\": f\"{window_success_rate:.1f}%\",\n                \"failed\": failed_delta,\n                \"cumulative_success_rate\": f\"{self.metrics.success_rate:.1f}%\",\n                \"p95_latency\": f\"{self.metrics.p95_latency:.3f}s\",\n            }\n            print(f\"[REPORT] {report}\")\n            self._last_snapshot = current\n# Usage with MonitoredProxyClient\nclient = MonitoredProxyClient(max_retries=3)\nreporter = PeriodicReporter(client.metrics, interval_seconds=30)\nreporter.start()\n# Scrape away — reports print every 30 seconds\nfor url in urls:\n    client.fetch(url)\nreporter.stop()\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>Alert Rules and Thresholds\u003C\u002Fh2>\n\u003Cp>Set up intelligent alerting that avoids false positives during warmup periods and transient blips.\u003C\u002Fp>\n\u003Ctable>\n\u003Ccaption>Alert Rules and Thresholds\u003C\u002Fcaption>\n\u003Cthead>\n\u003Ctr>\u003Cth>Alert\u003C\u002Fth>\u003Cth>Condition\u003C\u002Fth>\u003Cth>Cooldown\u003C\u002Fth>\u003Cth>Action\u003C\u002Fth>\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>Low Success Rate\u003C\u002Ftd>\u003Ctd>Below 90% over 5-minute window\u003C\u002Ftd>\u003Ctd>10 min\u003C\u002Ftd>\u003Ctd>Investigate target blocks, check proxy pool\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>High Latency\u003C\u002Ftd>\u003Ctd>p95 above 10s over 2-minute window\u003C\u002Ftd>\u003Ctd>5 min\u003C\u002Ftd>\u003Ctd>Reduce concurrency, check target health\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Error Spike\u003C\u002Ftd>\u003Ctd>Single error type exceeds 20% of requests\u003C\u002Ftd>\u003Ctd>5 min\u003C\u002Ftd>\u003Ctd>Check if target changed, rotate geo location\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Bandwidth Spike\u003C\u002Ftd>\u003Ctd>Transfer rate doubles from baseline\u003C\u002Ftd>\u003Ctd>15 min\u003C\u002Ftd>\u003Ctd>Verify expected behavior, check for redirect loops\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Zero Throughput\u003C\u002Ftd>\u003Ctd>No successful requests in 2 minutes\u003C\u002Ftd>\u003Ctd>2 min\u003C\u002Ftd>\u003Ctd>Check proxy connectivity, verify credentials\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cblockquote>Good monitoring is the difference between a scraping pipeline that runs reliably for months and one that silently produces garbage data. Invest in instrumentation upfront — it pays for itself on the first production incident you catch early.\u003C\u002Fblockquote>\n\u003Cp>For building the middleware that feeds these metrics, see \u003Ca href=\"\u002Fblog\u002Fproxy-middleware-layer\">Building a Proxy Middleware Layer\u003C\u002Fa>. For optimizing throughput alongside monitoring, read \u003Ca href=\"\u002Fblog\u002Fscaling-proxy-requests-concurrency\">Scaling Proxy Requests with Concurrency Control\u003C\u002Fa>. For the full system design, see \u003Ca href=\"\u002Fblog\u002Freliable-scraping-architecture\">Designing a Reliable Scraping Architecture\u003C\u002Fa>.\u003C\u002Fp>\n\u003Cp>Explore the \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FProxyHatCom\u002Fpython-sdk\">Python SDK\u003C\u002Fa>, \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FProxyHatCom\u002Fnode-sdk\">Node SDK\u003C\u002Fa>, and \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FProxyHatCom\u002Fgo-sdk\">Go SDK\u003C\u002Fa> for proxy integration, or check \u003Ca href=\"\u002Fpricing\">ProxyHat pricing\u003C\u002Fa> and \u003Ca href=\"https:\u002F\u002Fdocs.proxyhat.com\u002F\">documentation\u003C\u002Fa> to get started.\u003C\u002Fp>","Monitoring Proxy Performance","Monitor proxy performance with latency tracking, success rate metrics, structured logging, and smart alerting. Production code in Python, Node.js, and Go.","\u002Fblog\u002Fmonitoring-proxy-performance",null,"https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fmonitoring-proxy-performance-og.webp",[17,20,23,26,29],{"question":18,"answer":19},"What is the most important proxy metric to track?","Success rate is the single most important metric. It directly measures whether your proxy infrastructure is delivering usable data. A drop in success rate is the earliest indicator of blocks, proxy pool exhaustion, or target site changes.",{"question":21,"answer":22},"How often should I check proxy performance metrics?","For active scraping jobs, generate reports every 30-60 seconds. For ongoing monitoring, aggregate metrics in 5-minute windows. Alert on sustained degradation (multiple consecutive windows below threshold) rather than transient spikes.",{"question":24,"answer":25},"What p95 latency should I expect with residential proxies?","With ProxyHat residential proxies, typical p95 latency is 2-5 seconds depending on the target site and geographic distance. Values above 10 seconds consistently indicate network issues, overloaded targets, or insufficient concurrency limits.",{"question":27,"answer":28},"Should I track metrics per target domain?","Yes. Different targets have different block rates and response patterns. Per-domain metrics help you identify which targets need special handling — lower concurrency, different rotation strategies, or geo-targeted proxies from specific regions.",{"question":30,"answer":31},"How do I integrate proxy metrics with existing monitoring tools?","Export metrics in Prometheus format for Grafana dashboards, send structured JSON logs to Elasticsearch\u002FKibana, or use StatsD\u002FDataDog for real-time aggregation. The instrumented clients in this guide produce metrics compatible with any of these approaches.",[33,34,35,36],"Proxy infrastructure often fails silently, making monitoring essential to catch performance degradation before it impacts data pipelines.","Track key metrics like success rate, response latency (p50\u002Fp95\u002Fp99), error rates by type, and bandwidth usage to evaluate proxy health.","Set alert thresholds such as success rate below 90% or p95 latency above 10 seconds to catch issues early.","Use instrumented proxy clients in Python, Node.js, or Go to automatically collect metrics and trigger alerts.",false,"2026-02-15T00:39:23+00:00","2026-07-19T03:13:07+00:00","2026-10-03T08:21:37+00:00","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fmonitoring-proxy-performance-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fmonitoring-proxy-performance-card.webp",11,{"name":45,"slug":46,"bio":47,"avatar_url":14,"website_url":14,"social_links":14},"ProxyHat Team","proxyhat-team","The ProxyHat editorial team covers proxies, web scraping, and data extraction.",[49],{"id":50,"slug":51,"name":52,"description":14,"meta_title":53,"meta_description":54,"parent_id":14},4,"developer-guides","Developer Guides","Developer Guides | ProxyHat Blog","Code tutorials and SDK guides for integrating proxies into your applications.",[56,60],{"id":57,"slug":58,"name":59},1,"web-scraping","Web Scraping",{"id":61,"slug":62,"name":63},12,"sdk","SDK",{"en":13,"tr":65,"it":66,"ru":67,"es":68,"pt":69,"pl":70,"de":71,"fr":72,"zh":73,"ja":74,"ko":75,"x-default":13},"\u002Ftr\u002Fblog\u002Fproxy-performansini-izleme","\u002Fit\u002Fblog\u002Fmonitoraggio-delle-prestazioni-del-proxy-latenza-il-tasso-di-successo-e-gli-avvisi","\u002Fru\u002Fblog\u002Fmonitoring-proizvoditelnosti-proksi","\u002Fes\u002Fblog\u002Fmonitoreo-rendimiento-proxy","\u002Fpt\u002Fblog\u002Fmonitorando-desempenho-de-proxy","\u002Fpl\u002Fblog\u002Fmonitorowanie-wydajnosci-proxy-opoznienie-wskaznik-sukcesu-i-alerty","\u002Fde\u002Fblog\u002Fproxy-performance-ueberwachen","\u002Ffr\u002Fblog\u002Fsurveiller-la-performance-des-proxies","\u002Fcn\u002Fblog\u002Fjiankong-daili-xingneng","\u002Fja\u002Fblog\u002Fprokishi-pafoomansu-no-kanshi","\u002Fko\u002Fblog\u002Fproxy-seongneung-monitoring",{"en":13,"tr":65,"it":66,"ru":67,"es":68,"pt":69,"pl":70,"de":71,"fr":72,"zh":73,"ja":74,"ko":75},75,[79,96,116,133],{"id":80,"slug":81,"title":82,"excerpt":83,"featured_image_url":84,"featured_image_alt":14,"card_image_url":85,"og_image_url":86,"published_at":87,"updated_at":39,"content_updated_at":88,"reading_time_minutes":61,"is_featured":37,"indexable":37,"views":89,"author":90,"categories":91,"tags":93},50,"reliable-scraping-architecture","Designing a Reliable Scraping Architecture","Design an end-to-end scraping system: scheduler, URL queue, crawler pool, proxy layer, parser, storage, and monitoring. Production-ready Python code with architecture diagrams.","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Freliable-scraping-architecture-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Freliable-scraping-architecture-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Freliable-scraping-architecture-og.webp","2026-02-24T06:55:16+00:00","2026-10-03T08:21:20+00:00",68,{"name":45,"slug":46,"bio":47,"avatar_url":14,"website_url":14,"social_links":14},[92],{"id":50,"slug":51,"name":52,"description":14,"meta_title":53,"meta_description":54,"parent_id":14},[94,95],{"id":61,"slug":62,"name":63},{"id":57,"slug":58,"name":59},{"id":97,"slug":98,"title":99,"excerpt":100,"featured_image_url":101,"featured_image_alt":14,"card_image_url":102,"og_image_url":103,"published_at":104,"updated_at":39,"content_updated_at":105,"reading_time_minutes":106,"is_featured":37,"indexable":37,"views":107,"author":108,"categories":109,"tags":113},36,"scale-scraping-infrastructure","How to Scale Scraping Infrastructure","Architecture patterns for scaling web scraping: queue-based systems, pipeline design, horizontal scaling with containers, and proxy management at scale. Code in Python, Node.js, and Go.","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fscale-scraping-infrastructure-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fscale-scraping-infrastructure-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fscale-scraping-infrastructure-og.webp","2026-02-09T14:42:34+00:00","2026-02-25T23:52:12+00:00",10,49,{"name":45,"slug":46,"bio":47,"avatar_url":14,"website_url":14,"social_links":14},[110],{"id":57,"slug":58,"name":59,"description":14,"meta_title":111,"meta_description":112,"parent_id":14},"Web Scraping Guides & Tips | ProxyHat Blog","Learn web scraping techniques, proxy strategies, and data extraction best practices.",[114,115],{"id":57,"slug":58,"name":59},{"id":61,"slug":62,"name":63},{"id":117,"slug":118,"title":119,"excerpt":120,"featured_image_url":121,"featured_image_alt":14,"card_image_url":122,"og_image_url":123,"published_at":124,"updated_at":39,"content_updated_at":125,"reading_time_minutes":61,"is_featured":37,"indexable":37,"views":126,"author":127,"categories":128,"tags":130},35,"scaling-proxy-requests-concurrency","Scaling Proxy Requests with Concurrency Control","Master concurrency patterns for proxy-based scraping: asyncio semaphores, Promise pools, Go worker pools, rate limiters, and backpressure. Production code in Python, Node.js, and Go.","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fscaling-proxy-requests-concurrency-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fscaling-proxy-requests-concurrency-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fscaling-proxy-requests-concurrency-og.webp","2026-02-08T11:16:13+00:00","2026-10-03T08:21:21+00:00",358,{"name":45,"slug":46,"bio":47,"avatar_url":14,"website_url":14,"social_links":14},[129],{"id":50,"slug":51,"name":52,"description":14,"meta_title":53,"meta_description":54,"parent_id":14},[131,132],{"id":61,"slug":62,"name":63},{"id":57,"slug":58,"name":59},{"id":134,"slug":135,"title":136,"excerpt":137,"featured_image_url":138,"featured_image_alt":14,"card_image_url":139,"og_image_url":140,"published_at":141,"updated_at":39,"content_updated_at":142,"reading_time_minutes":61,"is_featured":37,"indexable":37,"views":143,"author":144,"categories":145,"tags":147},29,"proxy-middleware-layer","Building a Proxy Middleware Layer for Scraping","Design and build a production-grade proxy middleware layer with retry logic, failover, and metrics. Complete implementations in Python and Node.js using ProxyHat.","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fproxy-middleware-layer-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fproxy-middleware-layer-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fproxy-middleware-layer-og.webp","2026-02-02T07:15:32+00:00","2026-10-03T08:21:29+00:00",44,{"name":45,"slug":46,"bio":47,"avatar_url":14,"website_url":14,"social_links":14},[146],{"id":50,"slug":51,"name":52,"description":14,"meta_title":53,"meta_description":54,"parent_id":14},[148,149],{"id":61,"slug":62,"name":63},{"id":57,"slug":58,"name":59},[]]