From 8d1bae7604d8c56252e39fa4e67b592e43080847 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Tue, 14 Apr 2026 00:55:25 +0000 Subject: [PATCH] fix(docs): clarify metrics documentation for domain normalization and saturating gauges --- changelog.md | 6 ++++++ readme.metrics.md | 4 ++-- ts/00_commitinfo_data.ts | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index ac8d522..87c1d8f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2026-04-14 - 27.7.2 - fix(docs) +clarify metrics documentation for domain normalization and saturating gauges + +- Document that per-IP domain keys are normalized to lowercase and have trailing dots stripped before counting. +- Clarify that the saturating close pattern also applies to connection and UDP active gauges. + ## 2026-04-14 - 27.7.1 - fix(rustproxy-http,rustproxy-metrics) fix domain-scoped request host detection and harden connection metrics cleanup diff --git a/readme.metrics.md b/readme.metrics.md index 9782101..9d32637 100644 --- a/readme.metrics.md +++ b/readme.metrics.md @@ -78,7 +78,7 @@ Entries are pruned via `retain_routes()` when routes are removed. All seven maps for an IP are evicted when its active connection count drops to 0. Safety-net pruning in `sample_all()` catches entries orphaned by races. Snapshots cap at 100 IPs, sorted by active connections descending. -**Domain request tracking:** Records which domains each frontend IP has requested. Populated from HTTP Host headers (for HTTP/1.1, HTTP/2, HTTP/3 requests) and from SNI (for TLS passthrough connections). Capped at 256 domains per IP (`MAX_DOMAINS_PER_IP`) to prevent subdomain-spray abuse. Inner DashMap uses 2 shards to minimise base memory per IP (~200 bytes). Common case (IP + domain both known) is two DashMap reads + one atomic increment with zero allocation. +**Domain request tracking:** Records which domains each frontend IP has requested. Populated from HTTP Host headers (for HTTP/1.1, HTTP/2, HTTP/3 requests) and from SNI (for TLS passthrough connections). Domain keys are normalized to lowercase with any trailing dot stripped so the same hostname does not fragment across multiple counters. Capped at 256 domains per IP (`MAX_DOMAINS_PER_IP`) to prevent subdomain-spray abuse. Inner DashMap uses 2 shards to minimise base memory per IP (~200 bytes). Common case (IP + domain both known) is two DashMap reads + one atomic increment with zero allocation. ### Per-Backend Metrics (keyed by "host:port") @@ -110,7 +110,7 @@ Tracked via `ProtocolGuard` RAII guards and `FrontendProtocolTracker`. Five prot | ws | `ProtocolGuard::frontend("ws")` on WebSocket upgrade | | other | Fallback (TCP passthrough without HTTP) | -Uses `fetch_update` for saturating decrements to prevent underflow races. +Uses `fetch_update` for saturating decrements to prevent underflow races. The same saturating-close pattern is also used for connection and UDP active gauges. ### Backend Protocol Distribution diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index e1e4933..572029c 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartproxy', - version: '27.7.1', + version: '27.7.2', description: 'A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.' }