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
Closes: #36
* Add nginx.retries cli flag
* Add nginx.retry-interval cli flag
* Add handling of SIGTERM signals
* Add started log message
* Add createClientWithRetries test
* Add time.Duration env variables: timeout, nginxRetryInterval
* Fix error context: On OSS Failed to create client would be appended twice from nginx client and exporter
* Add environment variables to --help flag and readme.md
Copy file name to clipboardExpand all lines: README.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,13 +64,17 @@ To start the exporter we use the [docker run](https://docs.docker.com/engine/ref
64
64
Usage of ./nginx-prometheus-exporter:
65
65
-nginx.plus
66
66
Start the exporter for NGINX Plus. By default, the exporter is started for NGINX. The default value can be overwritten by NGINX_PLUS environment variable.
67
+
-nginx.retries int
68
+
A number of retries the exporter will make on start to connect to the NGINX stub_status page/NGINX Plus API before exiting with an error. The default value can be overwritten by NGINX_RETRIES environment variable.
69
+
-nginx.retry-interval duration
70
+
An interval between retries to connect to the NGINX stub_status page/NGINX Plus API on start. The default value can be overwritten by NGINX_RETRY_INTERVAL environment variable. (default 5s)
67
71
-nginx.scrape-uri string
68
72
A URI for scraping NGINX or NGINX Plus metrics.
69
73
For NGINX, the stub_status page must be available through the URI. For NGINX Plus -- the API. The default value can be overwritten by SCRAPE_URI environment variable. (default "http://127.0.0.1:8080/stub_status")
70
74
-nginx.ssl-verify
71
75
Perform SSL certificate verification. The default value can be overwritten by SSL_VERIFY environment variable. (default true)
72
76
-nginx.timeout duration
73
-
A timeout for scraping metrics from NGINX or NGINX Plus. (default 5s)
77
+
A timeout for scraping metrics from NGINX or NGINX Plus. The default value can be overwritten by TIMEOUT environment variable. (default 5s)
74
78
-web.listen-address string
75
79
An address to listen on for web interface and telemetry. The default value can be overwritten by LISTEN_ADDRESS environment variable. (default ":9113")
76
80
-web.telemetry-path string
@@ -84,7 +88,7 @@ Usage of ./nginx-prometheus-exporter:
84
88
* For NGINX, the following metrics are exported:
85
89
* All [stub_status](http://nginx.org/en/docs/http/ngx_http_stub_status_module.html) metrics.
86
90
* `nginx_up` -- shows the status of the last metric scrape: `1` for a successful scrape and `0` for a failed one.
87
-
91
+
88
92
Connect to the `/metrics` page of the running exporter to see the complete list of metrics along with their descriptions.
89
93
* For NGINX Plus, the following metrics are exported:
"Start the exporter for NGINX Plus. By default, the exporter is started for NGINX. The default value can be overwritten by NGINX_PLUS environment variable.")
For NGINX, the stub_status page must be available through the URI. For NGINX Plus -- the API. The default value can be overwritten by SCRAPE_URI environment variable.`)
"Perform SSL certificate verification. The default value can be overwritten by SSL_VERIFY environment variable.")
63
-
timeout=flag.Duration("nginx.timeout", 5*time.Second, "A timeout for scraping metrics from NGINX or NGINX Plus.")
114
+
timeout=flag.Duration("nginx.timeout",
115
+
defaultTimeout,
116
+
"A timeout for scraping metrics from NGINX or NGINX Plus. The default value can be overwritten by TIMEOUT environment variable.")
117
+
nginxRetries=flag.Int("nginx.retries",
118
+
defaultNginxRetries,
119
+
"A number of retries the exporter will make on start to connect to the NGINX stub_status page/NGINX Plus API before exiting with an error. The default value can be overwritten by NGINX_RETRIES environment variable.")
"An interval between retries to connect to the NGINX stub_status page/NGINX Plus API on start. The default value can be overwritten by NGINX_RETRY_INTERVAL environment variable.")
0 commit comments