You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-14Lines changed: 39 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,9 @@ NGINX Prometheus exporter makes it possible to monitor NGINX or NGINX Plus using
8
8
9
9
[NGINX](http://nginx.org) exposes a handful of metrics via the [stub_status page](http://nginx.org/en/docs/http/ngx_http_stub_status_module.html#stub_status). [NGINX Plus](https://www.nginx.com/products/nginx/) provides a richer set of metrics via the [API](https://nginx.org/en/docs/http/ngx_http_api_module.html) and the [monitoring dashboard](https://www.nginx.com/products/nginx/live-activity-monitoring/). NGINX Prometheus exporter fetches the metrics from a single NGINX or NGINX Plus, converts the metrics into appropriate Prometheus metrics types and finally exposes them via an HTTP server to be collected by [Prometheus](https://prometheus.io/).
10
10
11
-
**Note**: Currently it is only supported to run NGINX Prometheus Exporter in a Docker container.
12
-
13
11
## Getting Started
14
12
15
-
In this section, we show how to quickly run NGINX Prometheus Exporter in a container for NGINX or NGINX Plus.
13
+
In this section, we show how to quickly run NGINX Prometheus Exporter for NGINX or NGINX Plus.
16
14
17
15
### A Note about NGINX Ingress Controller
18
16
@@ -24,10 +22,9 @@ We assume that you have already installed Prometheus and NGINX or NGINX Plus. Ad
24
22
* Expose the built-in metrics in NGINX/NGINX Plus:
25
23
* For NGINX, expose the [stub_status page](http://nginx.org/en/docs/http/ngx_http_stub_status_module.html#stub_status) at `/stub_status` on port `8080`.
26
24
* For NGINX Plus, expose the [API](https://nginx.org/en/docs/http/ngx_http_api_module.html#api) at `/api` on port `8080`.
27
-
* Install Docker on the server where you’re planning to run the exporter.
28
25
* Configure Prometheus to scrape metrics from the server with the exporter. Note that the default scrape port of the exporter is `9113` and the default metrics path -- `/metrics`.
29
26
30
-
### Running the Exporter in a Container
27
+
### Running the Exporter in a Docker Container
31
28
32
29
To start the exporter we use the [docker run](https://docs.docker.com/engine/reference/run/) command.
33
30
@@ -43,6 +40,22 @@ To start the exporter we use the [docker run](https://docs.docker.com/engine/ref
43
40
```
44
41
where `<nginx-plus>` is the IP address/DNS name, through which NGINX Plus is available.
where `<nginx-plus>` is the IP address/DNS name, through which NGINX Plus is available.
56
+
57
+
**Note**. The `nginx-prometheus-exporter` is not a daemon. To run the exporter as a system service (daemon), configure the init system of your Linux server (such as systemd or Upstart) accordingly. Alternatively, you can run the exporter in a Docker container.
58
+
46
59
## Usage
47
60
48
61
### Command-line Arguments
@@ -79,27 +92,39 @@ Usage of ./nginx-prometheus-exporter:
79
92
80
93
### Troubleshooting
81
94
82
-
The exporter logs errors to the standard output. If the exporter doesn’t work as expected, check its logs using [docker logs](https://docs.docker.com/engine/reference/commandline/logs/) command.
95
+
The exporter logs errors to the standard output. When using Docker, if the exporter doesn’t work as expected, check its logs using [docker logs](https://docs.docker.com/engine/reference/commandline/logs/) command.
83
96
84
97
## Releases
85
98
86
-
For each release, we publish the corresponding Docker image at `nginx/nginx-prometheus-exporter` [DockerHub repo](https://hub.docker.com/r/nginx/nginx-prometheus-exporter/). See the GitHub [releases page](https://github.com/nginxinc/nginx-prometheus-exporter/releases) for the list of all releases and the [CHANGELOG.md](CHANGELOG.md) for the changelog.
99
+
For each release, we publish the corresponding Docker image at `nginx/nginx-prometheus-exporter` [DockerHub repo](https://hub.docker.com/r/nginx/nginx-prometheus-exporter/) and the binaries on the GitHub [releases page](https://github.com/nginxinc/nginx-prometheus-exporter/releases).
87
100
88
-
## Building the Container Image
101
+
## Building the Exporter
89
102
90
-
You can build the exporter image using the provided Makefile. Before building the image, make sure the following software is installed on your machine:
103
+
You can build the exporter using the provided Makefile. Before building the exporter, make sure the following software is installed on your machine:
91
104
* make
92
-
* Docker
93
105
* git
106
+
* Docker for building the container image
107
+
* Go for building the binary
108
+
109
+
### Building the Docker Image
94
110
95
-
To build the image, run:
111
+
To build the Docker image with the exporter, run:
96
112
```
97
113
$ make container
98
114
```
99
115
100
-
Note:
101
-
* golang is not required, as the exporter binary is built in a Docker container. See the [Dockerfile](Dockerfile).
102
-
* The Makefile supports a few variables which can override its default behaviour. See [its content](Makefile).
116
+
Note: go is not required, as the exporter binary is built in a Docker container. See the [Dockerfile](Dockerfile).
117
+
118
+
### Building the Binary
119
+
120
+
To build the binary, run:
121
+
```
122
+
$ make
123
+
```
124
+
125
+
Note: the binary is built for the OS/arch of your machine. To build binaries for other platforms, see the [Makefile](Makefile).
126
+
127
+
The binary is built with the name `nginx-prometheus-exporter`.
0 commit comments