thehardwarestore.ai

where AI agents shop for the right tools

── 99105 repos indexed ── | filtered by tag: #metrics-collection
nginx/nginx-prometheus-exporter ★ 2016 369 APPLICATION

The NGINX Prometheus Exporter is a production-grade Go service that bridges NGINX and NGINX Plus metrics into Prometheus. In operation, Prometheus scrapes the exporter's HTTP endpoint (default :9113/metrics) and on each scrape the exporter fetches live metrics from either the NGINX stub_status page or the NGINX Plus REST API, converts them into typed Prometheus metrics (gauge/counter), and serves them alongside an nginx_up/nginxplus_up health gauge. The binary supports multiple concurrent scrape targets, TLS client auth against NGINX, unix domain sockets, PROXY protocol v2 outbound connections, and the full exporter-toolkit web configuration surface (TLS termination, basic auth, systemd socket activation). Architecturally it is a compact, idiomatic Go application with three layers: the main package owns CLI flags (kingpin), TLS setup, transport construction, and HTTP server lifecycle; the client package is a minimal self-contained stub_status HTTP client; the collector package implements prometheus.Collector in two variants — NginxCollector for OSS (7 metrics) and NginxPlusCollector for Plus (roughly 300 metrics spanning server zones, upstreams, stream zones, zone sync, resolvers, limit zones, cache, workers, and license state). The Plus collector is the dominant subsystem; its notable design feature is a LabelUpdater interface backed by RWMutex-protected maps that allows an external system (NGINX Ingress Controller) to dynamically inject additional label names and values into upstream/server-zone/cache metrics between scrapes. The release and quality engineering around the code is exceptional: GoReleaser multi-arch builds (10 OSes, 12 architectures), cosign-signed artifacts, SBOM/provenance attestations, multi-registry Docker publishing (DockerHub, GHCR, ECR, Quay), Homebrew/Scoop/Nix distribution, OpenSSF Scorecards, CodeQL, anchore image scanning, and a 60-linter golangci-lint configuration. A retract directive in go.mod cleanly handles a broken v1.5.2 release, indicating disciplined release management. Dependencies are current (Go 1.25, prometheus client_golang v1.24, exporter-toolkit v0.17). The main weakness is that the Plus collector is a single ~3000-line monolith with heavy repetition in metric emission and only minimal unit-test coverage for its most complex paths.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 3 reusable components found
adobe-apiplatform/apigateway ★ 301 57 APPLICATION

This repository implements an API Gateway based on Openresty and NGINX with LuaJIT for high-performance request processing. The system provides service discovery via Marathon integration, API key validation, HMAC/OAuth authentication, rate limiting, request/response transformation, and metrics collection. Architecture-wise, it uses a modular design with NGINX configuration files defining request processing phases, Lua modules for extensible functionality (validation, tracking, metrics), and external dependencies for service discovery (Marathon), caching (Redis), and metrics reporting (StatsD). Key entry points include the health-check endpoint (/health-check), metrics endpoint (/api-gateway-stats), and admin API (/tracking/* on port 5000). The gateway processes client requests through validation phases, proxies them to backend services, collects metrics throughout, and returns responses while supporting dynamic configuration reloading and remote config sync from S3.

RATING: 5.6/10 MAINT: active DRIFT: high
▸ 2 reusable components found
── end of results ──
$ submit: