Collected sources and patterns will appear here. Add from search or the patterns library.
Provide a Prometheus-compatible metrics collection library/module for Nginx, implemented in Lua, so Nginx/Lua applications can expose Prometheus metrics.
Utility
stars
1,560
forks
234
Quant signals & adoption trajectory: With ~1560 stars and ~234 forks over ~3711 days (~10 years), the project clearly achieved meaningful mindshare and persistence. However, the provided velocity is 0.0/hr, which suggests either measurement artifacts or low recent activity. That combination usually means: (a) it’s stable and widely used, but (b) it’s not currently compounding via rapid feature velocity or a widening moat. Why defensibility is ~5/10: This is a practical instrumentation library (commodity functionality) rather than a category-defining platform. The technical moat is limited: most Prometheus metric exporters boil down to (1) maintaining metric state in Lua, and (2) rendering in Prometheus text exposition format behind an Nginx handler. Without a proprietary dataset, model, or deep integration that’s hard to replicate, competitors can clone quickly. What creates partial defensibility anyway: Nginx+Lua instrumentation has many edge cases (shared memory, worker isolation, consistent label handling, performance under high QPS, correct exposition semantics). Libraries that got these right over time tend to accumulate trust and become default choices in existing OpenResty/nginx Lua stacks. That creates switching friction at the ecosystem level even if the code itself is replicable. Key competitors & adjacent projects: - prometheus exporters for OpenResty/nginx: common community modules that expose /metrics from Nginx/Lua. - nginx-prometheus-* modules: various community exporters that implement Prometheus exposition directly in Nginx phases or via Lua. - general Prometheus instrumentation patterns in Lua: developers often roll their own exporters using shared dict + textformatters. - platform-native observability: managed platforms and newer frameworks increasingly add built-in Prometheus scraping/export, reducing need for small libraries. Frontier-lab (OpenAI/Anthropic/Google) risk: Medium. Frontier labs are unlikely to directly maintain an Nginx-Lua metrics library because it’s infrastructure plumbing rather than frontier-model capability. But they could incorporate the needed functionality into their larger developer platform, internal tooling, or recommended stacks. So this is not a direct ‘frontier labs will outcompete it in open source’, but it is still plausible that large platforms make similar capability readily available “for free” through adjacent products. Three-axis threat profile: 1) Platform domination risk: HIGH. Large platforms (cloud observability agents, Kubernetes-native monitoring stacks, and vendor “managed metrics” tooling) can effectively replace the need for a standalone Nginx-Lua metrics library by providing standardized exporters, sidecars, or built-in instrumentation in their agent/framework. Additionally, OpenResty ecosystem maintainers or major observability vendors could maintain an official module. 2) Market consolidation risk: HIGH. Observability/metrics tooling tends to consolidate around a few dominant ecosystems (Prometheus-compatible endpoints standardized by a few de facto approaches, and vendor agents that normalize scraping). A specialized Lua exporter is vulnerable to consolidation because it solves a narrow slice (Nginx metrics exposition), which can be absorbed by broader exporters or agents. 3) Displacement horizon: 1-2 years. Given novelty is incremental, and the functionality is straightforward to reproduce, a competing solution could displace it quickly if: (a) a stronger maintained OpenResty/nginx-native metrics exporter gains traction, (b) observability agents begin covering this use case universally, or (c) the project’s low recent velocity (as provided) signals slower evolution vs emerging Nginx/Lua/Prometheus conventions. Opportunities / risks: - Opportunity: The project’s long-lived adoption (10 years) indicates it’s battle-tested. If maintainers improve activity/velocity, add compatibility with modern Nginx/OpenResty features, and document best practices for shared dict / concurrency, it could regain momentum and raise switching costs. - Risk: Lack of demonstrated recent velocity (velocity ~0) and commodity nature of Prometheus exposition mean it can be overtaken by “better default” exporters. Also, Prometheus ecosystem is stable but continually refined (histograms, exemplars, relabeling conventions). If the project doesn’t track these, users can migrate. Conclusion: Solid, widely adopted, production-capable library for Nginx Lua Prometheus metrics, but with limited true technical moat beyond battle-tested correctness and ecosystem inertia. Hence defensibility ~5 and frontier risk medium, with high platform/market consolidation pressures and a relatively near displacement horizon.
TECH STACK
INTEGRATION
library_import
READINESS
The reusable building blocks distilled from this project — each a mechanism you could lift into your own.
MetricRegistry -> PrometheusHTTPResponse
Serialize in-memory thread-safe metric registries into Prometheus-compatible plaintext formatting over an HTTP pull endpoint.
WorkerLocalDelta -> SharedState
Buffer counter increments in worker-local memory and periodically flush changes to shared memory.