The NGINX Unit control API includes a /status
endpoint for usage statistics. This is a solution for exposing these metrics in Prometheus format.
The application (run by Unit) queries the /status
URI on the control socket and converts the JSON response into Prometheus text format. PHP and Python implementations are available.
These instructions assume an existing Unit installation with a working configuration. We will add a new listener on the default prometheus port (9090) and route it directly to the Prometheus app.
Step 0. Install the preferred Unit language module (unit-php
or unit-python
)