{"id":24056731,"url":"https://github.com/nginx/nginx-prometheus-exporter","last_synced_at":"2025-12-29T20:20:37.174Z","repository":{"id":37432332,"uuid":"135449032","full_name":"nginx/nginx-prometheus-exporter","owner":"nginx","description":"NGINX Prometheus Exporter for NGINX and NGINX Plus","archived":false,"fork":false,"pushed_at":"2025-05-13T03:53:01.000Z","size":5044,"stargazers_count":1784,"open_issues_count":22,"forks_count":363,"subscribers_count":35,"default_branch":"main","last_synced_at":"2025-05-13T04:29:26.276Z","etag":null,"topics":["nginx","prometheus","prometheus-exporter"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nginx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-05-30T13:45:19.000Z","updated_at":"2025-05-11T18:07:20.000Z","dependencies_parsed_at":"2023-12-27T09:32:30.702Z","dependency_job_id":"efac8b06-3fb9-4ec6-925c-bb95dca0dde1","html_url":"https://github.com/nginx/nginx-prometheus-exporter","commit_stats":{"total_commits":668,"total_committers":49,"mean_commits":13.63265306122449,"dds":0.4251497005988024,"last_synced_commit":"ed17e0f47156048abdf46d94eb79cf1911eaa1a3"},"previous_names":["nginx/nginx-prometheus-exporter","nginxinc/nginx-prometheus-exporter"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nginx%2Fnginx-prometheus-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nginx%2Fnginx-prometheus-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nginx%2Fnginx-prometheus-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nginx%2Fnginx-prometheus-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nginx","download_url":"https://codeload.github.com/nginx/nginx-prometheus-exporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254076850,"owners_count":22010611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nginx","prometheus","prometheus-exporter"],"created_at":"2025-01-09T05:01:32.378Z","updated_at":"2025-12-29T20:20:37.137Z","avatar_url":"https://github.com/nginx.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable-next-line first-line-h1 --\u003e\n[![OpenSSFScorecard](https://api.securityscorecards.dev/projects/github.com/nginx/nginx-prometheus-exporter/badge)](https://scorecard.dev/viewer/?uri=github.com/nginx/nginx-prometheus-exporter)\n[![CI](https://github.com/nginx/nginx-prometheus-exporter/actions/workflows/ci.yml/badge.svg)](https://github.com/nginx/nginx-prometheus-exporter/actions/workflows/ci.yml)\n[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B5618%2Fgithub.com%2Fnginx%2Fnginx-prometheus-exporter.svg?type=shield)](https://app.fossa.com/projects/custom%2B5618%2Fgithub.com%2Fnginx%2Fnginx-prometheus-exporter?ref=badge_shield)\n[![Go Report Card](https://goreportcard.com/badge/github.com/nginx/nginx-prometheus-exporter)](https://goreportcard.com/report/github.com/nginx/nginx-prometheus-exporter)\n[![codecov](https://codecov.io/gh/nginx/nginx-prometheus-exporter/graph/badge.svg?token=J6Oz10LWy3)](https://codecov.io/gh/nginx/nginx-prometheus-exporter)\n![GitHub all releases](https://img.shields.io/github/downloads/nginx/nginx-prometheus-exporter/total?logo=github)\n![GitHub release (latest by SemVer)](https://img.shields.io/github/downloads/nginx/nginx-prometheus-exporter/latest/total?sort=semver\u0026logo=github)\n[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/nginx/nginx-prometheus-exporter?logo=github\u0026sort=semver)](https://github.com/nginx/nginx-prometheus-exporter/releases/latest)\n[![nginx-prometheus-exporter](https://snapcraft.io/nginx-prometheus-exporter/badge.svg)](https://snapcraft.io/nginx-prometheus-exporter)\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/nginx/nginx-prometheus-exporter?logo=go)\n[![Docker Pulls](https://img.shields.io/docker/pulls/nginx/nginx-prometheus-exporter?logo=docker\u0026logoColor=white)](https://hub.docker.com/r/nginx/nginx-prometheus-exporter)\n![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/nginx/nginx-prometheus-exporter?logo=docker\u0026logoColor=white\u0026sort=semver)\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n\n# NGINX Prometheus Exporter\n\nNGINX Prometheus exporter makes it possible to monitor NGINX or NGINX Plus using Prometheus.\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n## Table of Contents\n\n- [Overview](#overview)\n- [Getting Started](#getting-started)\n  - [A Note about NGINX Ingress Controller](#a-note-about-nginx-ingress-controller)\n  - [Prerequisites](#prerequisites)\n  - [Running the Exporter in a Docker Container](#running-the-exporter-in-a-docker-container)\n  - [Running the Exporter Binary](#running-the-exporter-binary)\n- [Usage](#usage)\n  - [Command-line Arguments](#command-line-arguments)\n- [Exported Metrics](#exported-metrics)\n  - [Common metrics](#common-metrics)\n  - [Metrics for NGINX OSS](#metrics-for-nginx-oss)\n    - [Stub status metrics](#stub-status-metrics)\n  - [Metrics for NGINX Plus](#metrics-for-nginx-plus)\n    - [Connections](#connections)\n    - [HTTP](#http)\n    - [SSL](#ssl)\n    - [HTTP Server Zones](#http-server-zones)\n    - [Stream Server Zones](#stream-server-zones)\n    - [HTTP Upstreams](#http-upstreams)\n    - [Stream Upstreams](#stream-upstreams)\n    - [Stream Zone Sync](#stream-zone-sync)\n    - [Location Zones](#location-zones)\n    - [Resolver](#resolver)\n    - [HTTP Requests Rate Limiting](#http-requests-rate-limiting)\n    - [HTTP Connections Limiting](#http-connections-limiting)\n    - [Stream Connections Limiting](#stream-connections-limiting)\n    - [Cache](#cache)\n    - [Worker](#worker)\n- [Troubleshooting](#troubleshooting)\n- [Releases](#releases)\n  - [Docker images](#docker-images)\n  - [Binaries](#binaries)\n  - [Homebrew](#homebrew)\n  - [Snap](#snap)\n  - [Scoop](#scoop)\n  - [Nix](#nix)\n- [Building the Exporter](#building-the-exporter)\n  - [Building the Docker Image](#building-the-docker-image)\n  - [Building the Binary](#building-the-binary)\n- [Grafana Dashboard](#grafana-dashboard)\n- [SBOM (Software Bill of Materials)](#sbom-software-bill-of-materials)\n  - [Binaries](#binaries-1)\n  - [Docker Image](#docker-image)\n- [Provenance](#provenance)\n- [Contacts](#contacts)\n- [Contributing](#contributing)\n- [Support](#support)\n- [License](#license)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Overview\n\n[NGINX](https://nginx.org) exposes a handful of metrics via the [stub_status\npage](https://nginx.org/en/docs/http/ngx_http_stub_status_module.html#stub_status). [NGINX\nPlus](https://www.nginx.com/products/nginx/) provides a richer set of metrics via the\n[API](https://nginx.org/en/docs/http/ngx_http_api_module.html) and the [monitoring\ndashboard](https://docs.nginx.com/nginx/admin-guide/monitoring/live-activity-monitoring/). NGINX Prometheus exporter\nfetches the metrics from a single NGINX or NGINX Plus, converts the metrics into appropriate Prometheus metrics types\nand finally exposes them via an HTTP server to be collected by [Prometheus](https://prometheus.io/).\n\n## Getting Started\n\nIn this section, we show how to quickly run NGINX Prometheus Exporter for NGINX or NGINX Plus.\n\n### A Note about NGINX Ingress Controller\n\nIf you’d like to use the NGINX Prometheus Exporter with [NGINX Ingress\nController](https://github.com/nginx/kubernetes-ingress/) for Kubernetes, see [this\ndoc](https://docs.nginx.com/nginx-ingress-controller/logging-and-monitoring/prometheus/) for the installation\ninstructions.\n\n### Prerequisites\n\nWe assume that you have already installed Prometheus and NGINX or NGINX Plus. Additionally, you need to:\n\n- Expose the built-in metrics in NGINX/NGINX Plus:\n  - For NGINX, expose the [stub_status\n    page](https://nginx.org/en/docs/http/ngx_http_stub_status_module.html#stub_status) at `/stub_status` on port `8080`.\n  - For NGINX Plus, expose the [API](https://nginx.org/en/docs/http/ngx_http_api_module.html#api) at `/api` on port\n    `8080`.\n- Configure Prometheus to scrape metrics from the server with the exporter. Note that the default scrape port of the\n  exporter is `9113` and the default metrics path -- `/metrics`.\n\n### Running the Exporter in a Docker Container\n\nTo start the exporter we use the [docker run](https://docs.docker.com/engine/reference/run/) command.\n\n- To export NGINX metrics, run:\n\n  ```console\n  docker run -p 9113:9113 nginx/nginx-prometheus-exporter:1.4.2 --nginx.scrape-uri=http://\u003cnginx\u003e:8080/stub_status\n  ```\n\n  where `\u003cnginx\u003e` is the IP address/DNS name, through which NGINX is available.\n\n- To export NGINX Plus metrics, run:\n\n  ```console\n  docker run -p 9113:9113 nginx/nginx-prometheus-exporter:1.4.2 --nginx.plus --nginx.scrape-uri=http://\u003cnginx-plus\u003e:8080/api\n  ```\n\n  where `\u003cnginx-plus\u003e` is the IP address/DNS name, through which NGINX Plus is available.\n\n### Running the Exporter Binary\n\n- To export NGINX metrics, run:\n\n  ```console\n  nginx-prometheus-exporter --nginx.scrape-uri=http://\u003cnginx\u003e:8080/stub_status\n  ```\n\n  where `\u003cnginx\u003e` is the IP address/DNS name, through which NGINX is available.\n\n- To export NGINX Plus metrics:\n\n  ```console\n  nginx-prometheus-exporter --nginx.plus --nginx.scrape-uri=http://\u003cnginx-plus\u003e:8080/api\n  ```\n\n  where `\u003cnginx-plus\u003e` is the IP address/DNS name, through which NGINX Plus is available.\n\n- To scrape NGINX metrics with unix domain sockets, run:\n\n  ```console\n  nginx-prometheus-exporter --nginx.scrape-uri=unix:\u003cnginx\u003e:/stub_status\n  ```\n\n  where `\u003cnginx\u003e` is the path to unix domain socket, through which NGINX stub status is available.\n\n**Note**. The `nginx-prometheus-exporter` is not a daemon. To run the exporter as a system service (daemon), you can\nfollow the example in [examples/systemd](./examples/systemd/README.md). Alternatively, you can run the exporter\nin a Docker container.\n\n## Usage\n\n### Command-line Arguments\n\n```console\nusage: nginx-prometheus-exporter [\u003cflags\u003e]\n\n\nFlags:\n  -h, --[no-]help                Show context-sensitive help (also try --help-long and --help-man).\n      --[no-]web.systemd-socket  Use systemd socket activation listeners instead\n                                 of port listeners (Linux only). ($SYSTEMD_SOCKET)\n      --web.listen-address=:9113 ...\n                                 Addresses on which to expose metrics and web interface. Repeatable for multiple addresses. ($LISTEN_ADDRESS)\n      --web.config.file=\"\"       Path to configuration file that can enable TLS or authentication. See: https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md ($CONFIG_FILE)\n      --web.telemetry-path=\"/metrics\"\n                                 Path under which to expose metrics. ($TELEMETRY_PATH)\n      --[no-]nginx.plus          Start the exporter for NGINX Plus. By default, the exporter is started for NGINX. ($NGINX_PLUS)\n      --nginx.scrape-uri=http://127.0.0.1:8080/stub_status ...\n                                 A URI or unix domain socket path for scraping NGINX or NGINX Plus metrics. For NGINX, the stub_status page must be available through the URI. For NGINX Plus -- the API. Repeatable for multiple URIs. ($SCRAPE_URI)\n      --[no-]nginx.ssl-verify    Perform SSL certificate verification. ($SSL_VERIFY)\n      --nginx.ssl-ca-cert=\"\"     Path to the PEM encoded CA certificate file used to validate the servers SSL certificate. ($SSL_CA_CERT)\n      --nginx.ssl-client-cert=\"\"\n                                 Path to the PEM encoded client certificate file to use when connecting to the server. ($SSL_CLIENT_CERT)\n      --nginx.ssl-client-key=\"\"  Path to the PEM encoded client certificate key file to use when connecting to the server. ($SSL_CLIENT_KEY)\n      --nginx.timeout=5s         A timeout for scraping metrics from NGINX or NGINX Plus. ($TIMEOUT)\n      --prometheus.const-label=PROMETHEUS.CONST-LABEL ...\n                                 Label that will be used in every metric. Format is label=value. It can be repeated multiple times. ($CONST_LABELS)\n      --log.level=info           Only log messages with the given severity or above. One of: [debug, info, warn, error]\n      --log.format=logfmt        Output format of log messages. One of: [logfmt, json]\n      --[no-]version             Show application version.\n```\n\n## Exported Metrics\n\n### Common metrics\n\n| Name                                         | Type     | Description                                  | Labels                                                                    |\n| -------------------------------------------- | -------- | -------------------------------------------- | ------------------------------------------------------------------------- |\n| `nginx_exporter_build_info`                  | Gauge    | Shows the exporter build information.        | `branch`, `goarch`, `goos`, `goversion`, `revision`, `tags` and `version` |\n| `promhttp_metric_handler_requests_total`     | Counter  | Total number of scrapes by HTTP status code. | `code` (the HTTP status code)                                             |\n| `promhttp_metric_handler_requests_in_flight` | Gauge    | Current number of scrapes being served.      | []                                                                        |\n| `go_*`                                       | Multiple | Go runtime metrics.                          | []                                                                        |\n\n### Metrics for NGINX OSS\n\n| Name       | Type  | Description                                                                                      | Labels |\n| ---------- | ----- | ------------------------------------------------------------------------------------------------ | ------ |\n| `nginx_up` | Gauge | Shows the status of the last metric scrape: `1` for a successful scrape and `0` for a failed one | []     |\n\n#### [Stub status metrics](https://nginx.org/en/docs/http/ngx_http_stub_status_module.html)\n\n| Name                         | Type    | Description                                                         | Labels |\n| ---------------------------- | ------- | ------------------------------------------------------------------- | ------ |\n| `nginx_connections_accepted` | Counter | Accepted client connections.                                        | []     |\n| `nginx_connections_active`   | Gauge   | Active client connections.                                          | []     |\n| `nginx_connections_handled`  | Counter | Handled client connections.                                         | []     |\n| `nginx_connections_reading`  | Gauge   | Connections where NGINX is reading the request header.              | []     |\n| `nginx_connections_waiting`  | Gauge   | Idle client connections.                                            | []     |\n| `nginx_connections_writing`  | Gauge   | Connections where NGINX is writing the response back to the client. | []     |\n| `nginx_http_requests_total`  | Counter | Total http requests.                                                | []     |\n\n### Metrics for NGINX Plus\n\n| Name           | Type  | Description                                                                                      | Labels |\n| -------------- | ----- | ------------------------------------------------------------------------------------------------ | ------ |\n| `nginxplus_up` | Gauge | Shows the status of the last metric scrape: `1` for a successful scrape and `0` for a failed one | []     |\n\n#### [Connections](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_connections)\n\n| Name                             | Type    | Description                        | Labels |\n| -------------------------------- | ------- | ---------------------------------- | ------ |\n| `nginxplus_connections_accepted` | Counter | Accepted client connections        | []     |\n| `nginxplus_connections_active`   | Gauge   | Active client connections          | []     |\n| `nginxplus_connections_dropped`  | Counter | Dropped client connections dropped | []     |\n| `nginxplus_connections_idle`     | Gauge   | Idle client connections            | []     |\n\n#### [HTTP](https://nginx.org/en/docs/http/ngx_http_api_module.html#http_)\n\n| Name                              | Type    | Description           | Labels |\n| --------------------------------- | ------- | --------------------- | ------ |\n| `nginxplus_http_requests_total`   | Counter | Total http requests   | []     |\n| `nginxplus_http_requests_current` | Gauge   | Current http requests | []     |\n\n#### [SSL](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_ssl_object)\n\n| Name                              | Type    | Description                         | Labels |\n| --------------------------------- | ------- | ----------------------------------- | ------ |\n| `nginxplus_ssl_handshakes`        | Counter | Successful SSL handshakes           | []     |\n| `nginxplus_ssl_handshakes_failed` | Counter | Failed SSL handshakes               | []     |\n| `nginxplus_ssl_session_reuses`    | Counter | Session reuses during SSL handshake | []     |\n\n#### [HTTP Server Zones](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_http_server_zone)\n\n| Name                                     | Type    | Description                                        | Labels                                                                                                                                     |\n| ---------------------------------------- | ------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |\n| `nginxplus_server_zone_processing`       | Gauge   | Client requests that are currently being processed | `server_zone`                                                                                                                              |\n| `nginxplus_server_zone_requests`         | Counter | Total client requests                              | `server_zone`                                                                                                                              |\n| `nginxplus_server_zone_responses`        | Counter | Total responses sent to clients                    | `code` (the response status code. The values are: `1xx`, `2xx`, `3xx`, `4xx` and `5xx`), `server_zone`                                     |\n| `nginxplus_server_zone_responses_codes`  | Counter | Total responses sent to clients by code            | `code` (the response status code. The possible values are [here](https://www.nginx.com/resources/wiki/extending/api/http/)), `server_zone` |\n| `nginxplus_server_zone_discarded`        | Counter | Requests completed without sending a response      | `server_zone`                                                                                                                              |\n| `nginxplus_server_zone_received`         | Counter | Bytes received from clients                        | `server_zone`                                                                                                                              |\n| `nginxplus_server_zone_sent`             | Counter | Bytes sent to clients                              | `server_zone`                                                                                                                              |\n| `nginxplus_server_ssl_handshakes`        | Counter | Successful SSL handshakes                          | `server_zone`                                                                                                                              |\n| `nginxplus_server_ssl_handshakes_failed` | Counter | Failed SSL handshakes                              | `server_zone`                                                                                                                              |\n| `nginxplus_server_ssl_session_reuses`    | Counter | Session reuses during SSL handshake                | `server_zone`                                                                                                                              |\n\n#### [Stream Server Zones](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_stream_server_zone)\n\n| Name                                            | Type    | Description                                           | Labels                                                                                    |\n| ----------------------------------------------- | ------- | ----------------------------------------------------- | ----------------------------------------------------------------------------------------- |\n| `nginxplus_stream_server_zone_processing`       | Gauge   | Client connections that are currently being processed | `server_zone`                                                                             |\n| `nginxplus_stream_server_zone_connections`      | Counter | Total connections                                     | `server_zone`                                                                             |\n| `nginxplus_stream_server_zone_sessions`         | Counter | Total sessions completed                              | `code` (the response status code. The values are: `2xx`, `4xx`, and `5xx`), `server_zone` |\n| `nginxplus_stream_server_zone_discarded`        | Counter | Connections completed without creating a session      | `server_zone`                                                                             |\n| `nginxplus_stream_server_zone_received`         | Counter | Bytes received from clients                           | `server_zone`                                                                             |\n| `nginxplus_stream_server_zone_sent`             | Counter | Bytes sent to clients                                 | `server_zone`                                                                             |\n| `nginxplus_stream_server_ssl_handshakes`        | Counter | Successful SSL handshakes                             | `server_zone`                                                                             |\n| `nginxplus_stream_server_ssl_handshakes_failed` | Counter | Failed SSL handshakes                                 | `server_zone`                                                                             |\n| `nginxplus_stream_server_ssl_session_reuses`    | Counter | Session reuses during SSL handshake                   | `server_zone`                                                                             |\n\n#### [HTTP Upstreams](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_http_upstream)\n\n\u003e Note: for the `state` metric, the string values are converted to float64 using the following rule: `\"up\"` -\u003e `1.0`,\n\u003e `\"draining\"` -\u003e `2.0`, `\"down\"` -\u003e `3.0`, `\"unavail\"` –\u003e `4.0`, `\"checking\"` –\u003e `5.0`, `\"unhealthy\"` -\u003e `6.0`.\n\n| Name                                                | Type    | Description                                                                                                                                                    | Labels                                                                                                                                            |\n| --------------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `nginxplus_upstream_server_state`                   | Gauge   | Current state                                                                                                                                                  | `server`, `upstream`                                                                                                                              |\n| `nginxplus_upstream_server_active`                  | Gauge   | Active connections                                                                                                                                             | `server`, `upstream`                                                                                                                              |\n| `nginxplus_upstream_server_limit`                   | Gauge   | Limit for connections which corresponds to the max_conns parameter of the upstream server. Zero value means there is no limit                                  | `server`, `upstream`                                                                                                                              |\n| `nginxplus_upstream_server_requests`                | Counter | Total client requests                                                                                                                                          | `server`, `upstream`                                                                                                                              |\n| `nginxplus_upstream_server_responses`               | Counter | Total responses sent to clients                                                                                                                                | `code` (the response status code. The values are: `1xx`, `2xx`, `3xx`, `4xx` and `5xx`), `server`, `upstream`                                     |\n| `nginxplus_upstream_server_responses_codes`         | Counter | Total responses sent to clients by code                                                                                                                        | `code` (the response status code. The possible values are [here](https://www.nginx.com/resources/wiki/extending/api/http/)), `server`, `upstream` |\n| nginxplus_upstream_server_sent`                     | Counter | Bytes sent to this server                                                                                                                                      | `server`, `upstream`                                                                                                                              |\n| `nginxplus_upstream_server_received`                | Counter | Bytes received to this server                                                                                                                                  | `server`, `upstream`                                                                                                                              |\n| `nginxplus_upstream_server_fails`                   | Counter | Number of unsuccessful attempts to communicate with the server                                                                                                 | `server`, `upstream`                                                                                                                              |\n| `nginxplus_upstream_server_unavail`                 | Counter | How many times the server became unavailable for client requests (state 'unavail') due to the number of unsuccessful attempts reaching the max_fails threshold | `server`, `upstream`                                                                                                                              |\n| `nginxplus_upstream_server_header_time`             | Gauge   | Average time to get the response header from the server                                                                                                        | `server`, `upstream`                                                                                                                              |\n| `nginxplus_upstream_server_response_time`           | Gauge   | Average time to get the full response from the server                                                                                                          | `server`, `upstream`                                                                                                                              |\n| `nginxplus_upstream_server_health_checks_checks`    | Counter | Total health check requests                                                                                                                                    | `server`, `upstream`                                                                                                                              |\n| `nginxplus_upstream_server_health_checks_fails`     | Counter | Failed health checks                                                                                                                                           | `server`, `upstream`                                                                                                                              |\n| `nginxplus_upstream_server_health_checks_unhealthy` | Counter | How many times the server became unhealthy (state 'unhealthy')                                                                                                 | `server`, `upstream`                                                                                                                              |\n| `nginxplus_upstream_server_ssl_handshakes`          | Counter | Successful SSL handshakes                                                                                                                                      | `server`, `upstream`                                                                                                                              |\n| `nginxplus_upstream_server_ssl_handshakes_failed`   | Counter | Failed SSL handshakes                                                                                                                                          | `server`, `upstream`                                                                                                                              |\n| `nginxplus_upstream_server_ssl_session_reuses`      | Counter | Session reuses during SSL handshake                                                                                                                            | `server`, `upstream`                                                                                                                              |\n| `nginxplus_upstream_keepalive`                      | Gauge   | Idle keepalive connections                                                                                                                                     | `upstream`                                                                                                                                        |\n| `nginxplus_upstream_zombies`                        | Gauge   | Servers removed from the group but still processing active client requests                                                                                     | `upstream`                                                                                                                                        |\n\n#### [Stream Upstreams](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_stream_upstream)\n\n\u003e Note: for the `state` metric, the string values are converted to float64 using the following rule: `\"up\"` -\u003e `1.0`,\n\u003e `\"down\"` -\u003e `3.0`, `\"unavail\"` –\u003e `4.0`, `\"checking\"` –\u003e `5.0`, `\"unhealthy\"` -\u003e `6.0`.\n\n| Name                                                       | Type    | Description                                                                                                                                                       | Labels                |\n| ---------------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |\n| `nginxplus_stream_upstream_server_state`                   | Gauge   | Current state                                                                                                                                                     | `server`, `upstream`  |\n| `nginxplus_stream_upstream_server_active`                  | Gauge   | Active connections                                                                                                                                                | `server` , `upstream` |\n| `nginxplus_stream_upstream_server_limit`                   | Gauge   | Limit for connections which corresponds to the max_conns parameter of the upstream server. Zero value means there is no limit                                     | `server` , `upstream` |\n| `nginxplus_stream_upstream_server_connections`             | Counter | Total number of client connections forwarded to this server                                                                                                       | `server`, `upstream`  |\n| `nginxplus_stream_upstream_server_connect_time`            | Gauge   | Average time to connect to the upstream server                                                                                                                    | `server`, `upstream`  |\n| `nginxplus_stream_upstream_server_first_byte_time`         | Gauge   | Average time to receive the first byte of data                                                                                                                    | `server`, `upstream`  |\n| `nginxplus_stream_upstream_server_response_time`           | Gauge   | Average time to receive the last byte of data                                                                                                                     | `server`, `upstream`  |\n| `nginxplus_stream_upstream_server_sent`                    | Counter | Bytes sent to this server                                                                                                                                         | `server`, `upstream`  |\n| `nginxplus_stream_upstream_server_received`                | Counter | Bytes received from this server                                                                                                                                   | `server`, `upstream`  |\n| `nginxplus_stream_upstream_server_fails`                   | Counter | Number of unsuccessful attempts to communicate with the server                                                                                                    | `server`, `upstream`  |\n| `nginxplus_stream_upstream_server_unavail`                 | Counter | How many times the server became unavailable for client connections (state 'unavail') due to the number of unsuccessful attempts reaching the max_fails threshold | `server`, `upstream`  |\n| `nginxplus_stream_upstream_server_health_checks_checks`    | Counter | Total health check requests                                                                                                                                       | `server`, `upstream`  |\n| `nginxplus_stream_upstream_server_health_checks_fails`     | Counter | Failed health checks                                                                                                                                              | `server`, `upstream`  |\n| `nginxplus_stream_upstream_server_health_checks_unhealthy` | Counter | How many times the server became unhealthy (state 'unhealthy')                                                                                                    | `server`, `upstream`  |\n| `nginxplus_stream_upstream_server_ssl_handshakes`          | Counter | Successful SSL handshakes                                                                                                                                         | `server`, `upstream`  |\n| `nginxplus_stream_upstream_server_ssl_handshakes_failed`   | Counter | Failed SSL handshakes                                                                                                                                             | `server`, `upstream`  |\n| `nginxplus_stream_upstream_server_ssl_session_reuses`      | Counter | Session reuses during SSL handshake                                                                                                                               | `server`, `upstream`  |\n| `nginxplus_stream_upstream_zombies`                        | Gauge   | Servers removed from the group but still processing active client connections                                                                                     | `upstream`            |\n\n#### [Stream Zone Sync](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_stream_zone_sync)\n\n| Name                                              | Type    | Description                                                  | Labels |\n| ------------------------------------------------- | ------- | ------------------------------------------------------------ | ------ |\n| `nginxplus_stream_zone_sync_zone_records_pending` | Gauge   | The number of records that need to be sent to the cluster    | `zone` |\n| `nginxplus_stream_zone_sync_zone_records_total`   | Gauge   | The total number of records stored in the shared memory zone | `zone` |\n| `nginxplus_stream_zone_sync_zone_bytes_in`        | Counter | Bytes received by this node                                  | []     |\n| `nginxplus_stream_zone_sync_zone_bytes_out`       | Counter | Bytes sent by this node                                      | []     |\n| `nginxplus_stream_zone_sync_zone_msgs_in`         | Counter | Total messages received by this node                         | []     |\n| `nginxplus_stream_zone_sync_zone_msgs_out`        | Counter | Total messages sent by this node                             | []     |\n| `nginxplus_stream_zone_sync_zone_nodes_online`    | Gauge   | Number of peers this node is connected to                    | []     |\n\n#### [Location Zones](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_http_location_zone)\n\n| Name                                      | Type    | Description                                   | Labels                                                                                                                                       |\n| ----------------------------------------- | ------- | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| `nginxplus_location_zone_requests`        | Counter | Total client requests                         | `location_zone`                                                                                                                              |\n| `nginxplus_location_zone_responses`       | Counter | Total responses sent to clients               | `code` (the response status code. The values are: `1xx`, `2xx`, `3xx`, `4xx` and `5xx`), `location_zone`                                     |\n| `nginxplus_location_zone_responses_codes` | Counter | Total responses sent to clients by code       | `code` (the response status code. The possible values are [here](https://www.nginx.com/resources/wiki/extending/api/http/)), `location_zone` |\n| `nginxplus_location_zone_discarded`       | Counter | Requests completed without sending a response | `location_zone`                                                                                                                              |\n| `nginxplus_location_zone_received`        | Counter | Bytes received from clients                   | `location_zone`                                                                                                                              |\n| `nginxplus_location_zone_sent`            | Counter | Bytes sent to clients                         | `location_zone`                                                                                                                              |\n\n#### [Resolver](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_resolver_zone)\n\n| Name                          | Type    | Description                                    | Labels     |\n| ----------------------------- | ------- | ---------------------------------------------- | ---------- |\n| `nginxplus_resolver_name`     | Counter | Total requests to resolve names to addresses   | `resolver` |\n| `nginxplus_resolver_srv`      | Counter | Total requests to resolve SRV records          | `resolver` |\n| `nginxplus_resolver_addr`     | Counter | Total requests to resolve addresses to names   | `resolver` |\n| `nginxplus_resolver_noerror`  | Counter | Total number of successful responses           | `resolver` |\n| `nginxplus_resolver_formerr`  | Counter | Total number of FORMERR responses              | `resolver` |\n| `nginxplus_resolver_servfail` | Counter | Total number of SERVFAIL responses             | `resolver` |\n| `nginxplus_resolver_nxdomain` | Counter | Total number of NXDOMAIN responses             | `resolver` |\n| `nginxplus_resolver_notimp`   | Counter | Total number of NOTIMP responses               | `resolver` |\n| `nginxplus_resolver_refused`  | Counter | Total number of REFUSED responses              | `resolver` |\n| `nginxplus_resolver_timedout` | Counter | Total number of timed out request              | `resolver` |\n| `nginxplus_resolver_unknown`  | Counter | Total requests completed with an unknown error | `resolver` |\n\n#### [HTTP Requests Rate Limiting](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_http_limit_req_zone)\n\n| Name                                       | Type    | Description                                                                 | Labels |\n| ------------------------------------------ | ------- | --------------------------------------------------------------------------- | ------ |\n| `nginxplus_limit_request_passed`           | Counter | Total number of requests that were neither limited nor accounted as limited | `zone` |\n| `nginxplus_limit_request_rejected`         | Counter | Total number of requests that were rejected                                 | `zone` |\n| `nginxplus_limit_request_delayed`          | Counter | Total number of requests that were delayed                                  | `zone` |\n| `nginxplus_limit_request_rejected_dry_run` | Counter | Total number of requests accounted as rejected in the dry run mode          | `zone` |\n| `nginxplus_limit_request_delayed_dry_run`  | Counter | Total number of requests accounted as delayed in the dry run mode           | `zone` |\n\n#### [HTTP Connections Limiting](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_http_limit_conn_zone)\n\n| Name                                          | Type    | Description                                                                    | Labels |\n| --------------------------------------------- | ------- | ------------------------------------------------------------------------------ | ------ |\n| `nginxplus_limit_connection_passed`           | Counter | Total number of connections that were neither limited nor accounted as limited | `zone` |\n| `nginxplus_limit_connection_rejected`         | Counter | Total number of connections that were rejected                                 | `zone` |\n| `nginxplus_limit_connection_rejected_dry_run` | Counter | Total number of connections accounted as rejected in the dry run mode          | `zone` |\n\n#### [Stream Connections Limiting](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_stream_limit_conn_zone)\n\n| Name                                                 | Type    | Description                                                                    | Labels |\n| ---------------------------------------------------- | ------- | ------------------------------------------------------------------------------ | ------ |\n| `nginxplus_stream_limit_connection_passed`           | Counter | Total number of connections that were neither limited nor accounted as limited | `zone` |\n| `nginxplus_stream_limit_connection_rejected`         | Counter | Total number of connections that were rejected                                 | `zone` |\n| `nginxplus_stream_limit_connection_rejected_dry_run` | Counter | Total number of connections accounted as rejected in the dry run mode          | `zone` |\n\n#### [Cache](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_http_cache)\n\n| Name                                        | Type    | Description                                                             | Labels  |\n| ------------------------------------------- | ------- | ----------------------------------------------------------------------- | ------- |\n| `nginxplus_cache_size`                      | Gauge   | Total size of the cache                                                 | `cache` |\n| `nginxplus_cache_max_size`                  | Gauge   | Maximum size of the cache                                               | `cache` |\n| `nginxplus_cache_cold`                      | Gauge   | Is the cache considered cold                                            | `cache` |\n| `nginxplus_cache_hit_responses`             | Counter | Total number of cache hits                                              | `cache` |\n| `nginxplus_cache_hit_bytes`                 | Counter | Total number of bytes returned from cache hits                          | `cache` |\n| `nginxplus_cache_stale_responses`           | Counter | Total number of stale cache hits                                        | `cache` |\n| `nginxplus_cache_stale_bytes`               | Counter | Total number of bytes returned from stale cache hits                    | `cache` |\n| `nginxplus_cache_updating_responses`        | Counter | Total number of cache hits while cache is updating                      | `cache` |\n| `nginxplus_cache_updating_bytes`            | Counter | Total number of bytes returned from cache while cache is updating       | `cache` |\n| `nginxplus_cache_revalidated_responses`     | Counter | Total number of cache revalidations                                     | `cache` |\n| `nginxplus_cache_revalidated_bytes`         | Counter | Total number of bytes returned from cache revalidations                 | `cache` |\n| `nginxplus_cache_miss_responses`            | Counter | Total number of cache misses                                            | `cache` |\n| `nginxplus_cache_miss_bytes`                | Counter | Total number of bytes returned from cache misses                        | `cache` |\n| `nginxplus_cache_expired_responses`         | Counter | Total number of cache hits with expired TTL                             | `cache` |\n| `nginxplus_cache_expired_bytes`             | Counter | Total number of bytes returned from cache hits with expired TTL         | `cache` |\n| `nginxplus_cache_expired_responses_written` | Counter | Total number of cache hits with expired TTL written to cache            | `cache` |\n| `nginxplus_cache_expired_bytes_written`     | Counter | Total number of bytes written to cache from cache hits with expired TTL | `cache` |\n| `nginxplus_cache_bypass_responses`          | Counter | Total number of cache bypasses                                          | `cache` |\n| `nginxplus_cache_bypass_bytes`              | Counter | Total number of bytes returned from cache bypasses                      | `cache` |\n| `nginxplus_cache_bypass_responses_written`  | Counter | Total number of cache bypasses written to cache                         | `cache` |\n| `nginxplus_cache_bypass_bytes_written`      | Counter | Total number of bytes written to cache from cache bypasses              | `cache` |\n\n#### [Worker](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_worker)\n\n| Name                                     | Type    | Description                                                              | Labels      |\n| ---------------------------------------- | ------- | ------------------------------------------------------------------------ | ----------- |\n| `nginxplus_worker_connection_accepted`   | Counter | The total number of accepted client connections                          | `id`, `pid` |\n| `nginxplus_worker_connection_dropped`    | Counter | The total number of dropped client connections                           | `id`, `pid` |\n| `nginxplus_worker_connection_active`     | Gauge   | The current number of active client connections                          | `id`, `pid` |\n| `nginxplus_worker_connection_idle`       | Gauge   | The current number of idle client connection                             | `id`, `pid` |\n| `nginxplus_worker_http_requests_total`   | Counter | The total number of client requests received                             | `id`, `pid` |\n| `nginxplus_worker_http_requests_current` | Gauge   | The current number of client requests that are currently being processed | `id`, `pid` |\n\nConnect to the `/metrics` page of the running exporter to see the complete list of metrics along with their\ndescriptions. Note: to see server zones related metrics you must configure [status\nzones](https://nginx.org/en/docs/http/ngx_http_api_module.html#status_zone) and to see upstream related metrics you\nmust configure upstreams with a [shared memory zone](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#zone).\n\n## Troubleshooting\n\nThe exporter logs errors to the standard output. When using Docker, if the exporter doesn’t work as expected, check its\nlogs using [docker logs](https://docs.docker.com/engine/reference/commandline/logs/) command.\n\n## Releases\n\n### Docker images\n\nWe publish the Docker image on [DockerHub](https://hub.docker.com/r/nginx/nginx-prometheus-exporter/),\n[GitHub Container](https://github.com/nginx/nginx-prometheus-exporter/pkgs/container/nginx-prometheus-exporter),\n[Amazon ECR Public Gallery](https://gallery.ecr.aws/nginx/nginx-prometheus-exporter) and\n[Quay.io](https://quay.io/repository/nginx/nginx-prometheus-exporter).\n\nAs an alternative, you can choose the _edge_ version built from the [latest commit](https://github.com/nginx/nginx-prometheus-exporter/commits/main)\nfrom the main branch. The edge version is useful for experimenting with new features that are not yet published in a\nstable release.\n\n### Binaries\n\nWe publish the binaries for multiple Operating Systems and architectures on the GitHub [releases page](https://github.com/nginx/nginx-prometheus-exporter/releases).\n\n### Homebrew\n\nYou can add the NGINX homebrew tap with\n\n```console\nbrew tap nginx/tap\n```\n\nand then install the formula with\n\n```console\nbrew install nginx-prometheus-exporter\n```\n\n### Snap\n\nYou can install the NGINX Prometheus Exporter from the [Snap Store](https://snapcraft.io/nginx-prometheus-exporter).\n\n```console\nsnap install nginx-prometheus-exporter\n```\n\n### Scoop\n\nYou can add the NGINX Scoop bucket with\n\n```console\nscoop bucket add nginx https://github.com/nginx/scoop-bucket.git\n```\n\nand then install the package with\n\n```console\nscoop install nginx-prometheus-exporter\n```\n\n### Nix\n\nFirst include NUR in your packageOverrides as explained in the [NUR documentation](https://github.com/nix-community/NUR#installation).\n\nThen you can use the exporter with the following command:\n\n```console\nnix-shell --packages nur.repos.nginx.nginx-prometheus-exporter\n```\n\nor install it with:\n\n```console\nnix-env -f '\u003cnixpkgs\u003e' -iA nur.repos.nginx.nginx-prometheus-exporter\n```\n\n## Building the Exporter\n\nYou can build the exporter using the provided Makefile. Before building the exporter, make sure the following software\nis installed on your machine:\n\n- make\n- git\n- Docker for building the container image\n- Go for building the binary\n\n### Building the Docker Image\n\nTo build the Docker image with the exporter, run:\n\n```console\nmake container\n```\n\nNote: go is not required, as the exporter binary is built in a Docker container. See the [Dockerfile](build/Dockerfile).\n\n### Building the Binary\n\nTo build the binary, run:\n\n```console\nmake\n```\n\nNote: the binary is built for the OS/arch of your machine. To build binaries for other platforms, see the\n[Makefile](Makefile).\n\nThe binary is built with the name `nginx-prometheus-exporter`.\n\n## Grafana Dashboard\n\nThe official Grafana dashboard is provided with the exporter for NGINX. Check the [Grafana\nDashboard](./grafana/README.md) documentation for more information.\n\n## SBOM (Software Bill of Materials)\n\nWe generate SBOMs for the binaries and the Docker image.\n\n### Binaries\n\nThe SBOMs for the binaries are available in the releases page. The SBOMs are generated using\n[syft](https://github.com/anchore/syft) and are available in SPDX format.\n\n### Docker Image\n\nThe SBOM for the Docker image is available in the\n[DockerHub](https://hub.docker.com/r/nginx/nginx-prometheus-exporter),\n[GitHub Container registry](https://github.com/nginx/nginx-prometheus-exporter/pkgs/container/nginx-prometheus-exporter),\n[Amazon ECR Public Gallery](https://gallery.ecr.aws/nginx/nginx-prometheus-exporter) and\n[Quay.io](https://quay.io/repository/nginx/nginx-prometheus-exporter) repositories. The SBOMs are generated using\n[syft](https://github.com/anchore/syft) and stored as an attestation in the image manifest.\n\nFor example to retrieve the SBOM for `linux/amd64` from Docker Hub and analyze it using\n[grype](https://github.com/anchore/grype) you can run the following command:\n\n```console\ndocker buildx imagetools inspect nginx/nginx-prometheus-exporter:edge --format '{{ json (index .SBOM \"linux/amd64\").SPDX }}' | grype\n```\n\n## Provenance\n\nWe generate provenance for the Docker image and it's available in the\n[DockerHub](https://hub.docker.com/r/nginx/nginx-prometheus-exporter),\n[GitHub Container registry](https://github.com/nginx/nginx-prometheus-exporter/pkgs/container/nginx-prometheus-exporter),\n[Amazon ECR Public Gallery](https://gallery.ecr.aws/nginx/nginx-prometheus-exporter) and\n[Quay.io](https://quay.io/repository/nginx/nginx-prometheus-exporter) repositories, stored as an attestation in the\nimage manifest.\n\nFor example to retrieve the provenance for `linux/amd64` from Docker Hub you can run the following command:\n\n```console\ndocker buildx imagetools inspect nginx/nginx-prometheus-exporter:edge --format '{{ json (index .Provenance \"linux/amd64\").SLSA }}'\n```\n\n## Contacts\n\nWe’d like to hear your feedback! If you have any suggestions or experience issues with the NGINX Prometheus Exporter,\nplease create an issue or send a pull request on GitHub. You can contact us on the [NGINX Community Forums](https://community.nginx.org/).\n\n## Contributing\n\nIf you'd like to contribute to the project, please read our [Contributing guide](CONTRIBUTING.md).\n\n## Support\n\nThe commercial support is available for NGINX Plus customers when the NGINX Prometheus Exporter is used with NGINX\nIngress Controller.\n\n## License\n\n[Apache License, Version 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnginx%2Fnginx-prometheus-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnginx%2Fnginx-prometheus-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnginx%2Fnginx-prometheus-exporter/lists"}