# SPDX-License-Identifier: Apache-2.0
Source: nginx-ipng-stats-plugin
Section: httpd
Priority: optional
Maintainer: Pim van Pelt <pim@ipng.ch>
Build-Depends:
 debhelper-compat (= 13),
 nginx-dev,
 libpcre2-dev,
 zlib1g-dev,
 libssl-dev
Standards-Version: 4.6.2
Homepage: https://git.ipng.ch/ipng/nginx-ipng-stats-plugin
Rules-Requires-Root: no

Package: libnginx-mod-http-ipng-stats
Architecture: any
Depends:
 ${misc:Depends},
 ${shlibs:Depends},
 nginx (>= 1.26~)
Description: nginx dynamic module for per-VIP, per-device traffic counters
 This package ships ngx_http_ipng_stats_module as a dynamic module
 loadable into stock upstream nginx on Debian. The module records
 per-VIP HTTP request counters, status code distribution, bytes in
 and out, and request-duration histograms, and attributes each
 request to the interface it arrived on. Counters are exposed as
 Prometheus text and JSON from a single scrape endpoint.
 .
 Attribution is done by reading the ingress ifindex per connection
 from the kernel's IP_PKTINFO / IPV6_PKTINFO cmsg; listening sockets
 stay plain wildcards so outgoing packets follow the normal routing
 table (which matters for DSR / maglev setups). The module adds
 device= and ipng_source_tag= parameters to the nginx listen
 directive, mapping interface names to source tags.
 .
 The module also provides an ipng_stats_logtail http-level directive
 that ships every request as a UDP datagram to a collector, using a
 named nginx log_format (so $ipng_source_tag and $server_addr are
 available alongside the standard access-log variables). Each worker
 holds a private in-memory buffer flushed on size or timer, over a
 per-worker SOCK_DGRAM socket resolved once at configuration time.
 Delivery is fire-and-forget — zero disk I/O, no backpressure — and
 an if=$variable parameter suppresses selected requests (e.g. health
 checks) before the format is rendered.
 .
 Typical use cases include GRE tunnel fleets, VLAN trunks, or any
 deployment where traffic arrives on distinct interfaces and
 per-interface observability is needed.
