Skip to content

Commit cbf7f33

Browse files
committed
Release 1.0.0 (#506)
1 parent 44a1e7c commit cbf7f33

File tree

5 files changed

+62
-71
lines changed

5 files changed

+62
-71
lines changed

.github/workflows/ci.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ jobs:
6060
id: go
6161
run: |
6262
echo "go_path=$(go env GOPATH)" >> $GITHUB_OUTPUT
63+
6364
- name: Setup QEMU
6465
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
6566
with:
@@ -68,6 +69,9 @@ jobs:
6869

6970
- name: Docker Buildx
7071
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
72+
with:
73+
version: latest
74+
7175
- name: DockerHub Login
7276
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
7377
with:
@@ -160,10 +164,6 @@ jobs:
160164
mkdir -p $HOME/.cache/snapcraft/stage-packages
161165
if: github.ref_type == 'tag'
162166

163-
- name: Login to Snapcraft
164-
run: snapcraft login --with <(echo "${{ secrets.SNAPCRAFT_LOGIN }}")
165-
if: github.ref_type == 'tag'
166-
167167
- name: Run GoReleaser
168168
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
169169
with:
@@ -174,6 +174,7 @@ jobs:
174174
GOPATH: ${{ steps.go.outputs.go_path }}
175175
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.NGINX_PAT }}
176176
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_COMMUNITY }}
177+
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_LOGIN }}
177178

178179
- name: Print NGINX Prometheus Exporter info
179180
run: ./dist/nginx-prometheus-exporter_linux_amd64_v1/nginx-prometheus-exporter --version
@@ -188,7 +189,7 @@ jobs:
188189
platforms: ${{ github.event_name != 'pull_request' && env.DOCKER_PLATFORMS || '' }}
189190
tags: ${{ steps.meta.outputs.tags }}
190191
labels: ${{ steps.meta.outputs.labels }}
191-
annotations: ${{ steps.meta.outputs.annotations }}
192+
annotations: ${{ github.event_name != 'pull_request' && steps.meta.outputs.annotations || '' }}
192193
load: ${{ github.event_name == 'pull_request' }}
193194
push: ${{ github.event_name != 'pull_request' }}
194195
cache-from: type=gha

CHANGELOG.md

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
# Changelog
22

3-
## 0.11.0
4-
5-
A list of changes can be found on Github at: [Release v0.11.0](https://github.com/nginxinc/nginx-prometheus-exporter/releases/tag/v0.11.0)
6-
7-
## 0.10.0
8-
9-
A list of changes can be found on Github at: [Release v0.10.0](https://github.com/nginxinc/nginx-prometheus-exporter/releases/tag/v0.10.0)
10-
11-
## 0.9.0
12-
13-
A list of changes can be found on Github at: [Release v0.9.0](https://github.com/nginxinc/nginx-prometheus-exporter/releases/tag/v0.9.0)
3+
Starting with version 0.9.0 an automatically generated list of changes can be found on the [GitHub Releases page](https://github.com/nginxinc/nginx-prometheus-exporter/releases).
144

155
## 0.8.0
166

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = 0.11.0
1+
VERSION = 1.0.0
22
TAG = $(VERSION)
33
PREFIX = nginx/nginx-prometheus-exporter
44

README.md

+53-53
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- markdownlint-disable-next-line first-line-h1 -->
22
[![OpenSSFScorecard](https://api.securityscorecards.dev/projects/github.com/nginxinc/nginx-prometheus-exporter/badge)](https://api.securityscorecards.dev/projects/github.com/nginxinc/nginx-prometheus-exporter)
3-
[![CI](https://github.com/nginxinc/nginx-prometheus-exporter/workflows/Continuous%20Integration/badge.svg)](https://github.com/nginxinc/nginx-prometheus-exporter/actions?query=workflow%3A%22Continuous+Integration%22)
3+
[![CI](https://github.com/nginxinc/nginx-prometheus-exporter/actions/workflows/ci.yml/badge.svg)](https://github.com/nginxinc/nginx-prometheus-exporter/actions/workflows/ci.yml)
44
[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B5618%2Fgithub.com%2Fnginxinc%2Fnginx-prometheus-exporter.svg?type=shield)](https://app.fossa.com/projects/custom%2B5618%2Fgithub.com%2Fnginxinc%2Fnginx-prometheus-exporter?ref=badge_shield)
55
[![Go Report Card](https://goreportcard.com/badge/github.com/nginxinc/nginx-prometheus-exporter)](https://goreportcard.com/report/github.com/nginxinc/nginx-prometheus-exporter)
66
![GitHub all releases](https://img.shields.io/github/downloads/nginxinc/nginx-prometheus-exporter/total?logo=github)
@@ -11,6 +11,7 @@
1111
[![Docker Pulls](https://img.shields.io/docker/pulls/nginx/nginx-prometheus-exporter?logo=docker&logoColor=white)](https://hub.docker.com/r/nginx/nginx-prometheus-exporter)
1212
![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/nginx/nginx-prometheus-exporter?logo=docker&logoColor=white&sort=semver)
1313
[![Slack](https://img.shields.io/badge/slack-%23nginx--prometheus--exporter-green?logo=slack)](https://nginxcommunity.slack.com/channels/nginx-prometheus-exporter)
14+
[![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)
1415

1516
# NGINX Prometheus Exporter
1617

@@ -56,15 +57,15 @@ To start the exporter we use the [docker run](https://docs.docker.com/engine/ref
5657
- To export NGINX metrics, run:
5758

5859
```console
59-
docker run -p 9113:9113 nginx/nginx-prometheus-exporter:0.10.0 -nginx.scrape-uri=http://<nginx>:8080/stub_status
60+
docker run -p 9113:9113 nginx/nginx-prometheus-exporter:1.0.0 --nginx.scrape-uri=http://<nginx>:8080/stub_status
6061
```
6162

6263
where `<nginx>` is the IP address/DNS name, through which NGINX is available.
6364

6465
- To export NGINX Plus metrics, run:
6566

6667
```console
67-
docker run -p 9113:9113 nginx/nginx-prometheus-exporter:0.10.0 -nginx.plus -nginx.scrape-uri=http://<nginx-plus>:8080/api
68+
docker run -p 9113:9113 nginx/nginx-prometheus-exporter:1.0.0 --nginx.plus --nginx.scrape-uri=http://<nginx-plus>:8080/api
6869
```
6970

7071
where `<nginx-plus>` is the IP address/DNS name, through which NGINX Plus is available.
@@ -74,71 +75,60 @@ To start the exporter we use the [docker run](https://docs.docker.com/engine/ref
7475
- To export NGINX metrics, run:
7576

7677
```console
77-
nginx-prometheus-exporter -nginx.scrape-uri=http://<nginx>:8080/stub_status
78+
nginx-prometheus-exporter --nginx.scrape-uri=http://<nginx>:8080/stub_status
7879
```
7980

8081
where `<nginx>` is the IP address/DNS name, through which NGINX is available.
8182

8283
- To export NGINX Plus metrics:
8384

8485
```console
85-
nginx-prometheus-exporter -nginx.plus -nginx.scrape-uri=http://<nginx-plus>:8080/api
86+
nginx-prometheus-exporter --nginx.plus --nginx.scrape-uri=http://<nginx-plus>:8080/api
8687
```
8788

8889
where `<nginx-plus>` is the IP address/DNS name, through which NGINX Plus is available.
8990

90-
- To export and scrape NGINX metrics with unix domain sockets, run:
91+
- To scrape NGINX metrics with unix domain sockets, run:
9192

9293
```console
93-
nginx-prometheus-exporter -nginx.scrape-uri=unix:<nginx>:/stub_status -web.listen-address=unix:/path/to/socket.sock
94+
nginx-prometheus-exporter --nginx.scrape-uri=unix:<nginx>:/stub_status
9495
```
9596

9697
where `<nginx>` is the path to unix domain socket, through which NGINX stub status is available.
9798

98-
**Note**. The `nginx-prometheus-exporter` is not a daemon. To run the exporter as a system service (daemon), configure
99-
the init system of your Linux server (such as systemd or Upstart) accordingly. Alternatively, you can run the exporter
99+
**Note**. The `nginx-prometheus-exporter` is not a daemon. To run the exporter as a system service (daemon), you can
100+
follow the example in [examples/systemd](./examples/systemd/README.md). Alternatively, you can run the exporter
100101
in a Docker container.
101102

102103
## Usage
103104

104105
### Command-line Arguments
105106

106107
```console
107-
Usage of ./nginx-prometheus-exporter:
108-
-nginx.plus
109-
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.
110-
-nginx.retries int
111-
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.
112-
-nginx.retry-interval duration
113-
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)
114-
-nginx.scrape-uri string
115-
A URI or unix domain socket path for scraping NGINX or NGINX Plus metrics.
116-
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")
117-
Configure this option with the URI for every nginx instance to scrape.
118-
-nginx.ssl-ca-cert string
119-
Path to the PEM encoded CA certificate file used to validate the servers SSL certificate. The default value can be overwritten by SSL_CA_CERT environment variable.
120-
-nginx.ssl-client-cert string
121-
Path to the PEM encoded client certificate file to use when connecting to the server. The default value can be overwritten by SSL_CLIENT_CERT environment variable.
122-
-nginx.ssl-client-key string
123-
Path to the PEM encoded client certificate key file to use when connecting to the server. The default value can be overwritten by SSL_CLIENT_KEY environment variable.
124-
-nginx.ssl-verify
125-
Perform SSL certificate verification. The default value can be overwritten by SSL_VERIFY environment variable. (default true)
126-
-nginx.timeout duration
127-
A timeout for scraping metrics from NGINX or NGINX Plus. The default value can be overwritten by TIMEOUT environment variable. (default 5s)
128-
-prometheus.const-labels value
129-
A comma separated list of constant labels that will be used in every metric. Format is label1=value1,label2=value2... The default value can be overwritten by CONST_LABELS environment variable.
130-
-web.listen-address string
131-
An address or unix domain socket path to listen on for web interface and telemetry. The default value can be overwritten by LISTEN_ADDRESS environment variable. (default ":9113")
132-
-web.telemetry-path string
133-
A path under which to expose metrics. The default value can be overwritten by TELEMETRY_PATH environment variable. (default "/metrics")
134-
-web.secured-metrics
135-
Expose metrics using https. The default value can be overwritten by SECURED_METRICS variable. (default false)
136-
-web.ssl-server-cert string
137-
Path to the PEM encoded certificate for the nginx-exporter metrics server(when web.secured-metrics=true). The default value can be overwritten by SSL_SERVER_CERT variable.
138-
-web.ssl-server-key string
139-
Path to the PEM encoded key for the nginx-exporter metrics server (when web.secured-metrics=true). The default value can be overwritten by SSL_SERVER_KEY variable.
140-
-version
141-
Display the NGINX exporter version. (default false)
108+
usage: nginx-prometheus-exporter [<flags>]
109+
110+
111+
Flags:
112+
-h, --[no-]help Show context-sensitive help (also try --help-long and --help-man).
113+
--web.listen-address=:9113 ...
114+
Addresses on which to expose metrics and web interface. Repeatable for multiple addresses.
115+
--web.config.file="" [EXPERIMENTAL] Path to configuration file that can enable TLS or authentication. See: https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md
116+
--web.telemetry-path="/metrics"
117+
Path under which to expose metrics. ($TELEMETRY_PATH)
118+
--[no-]nginx.plus Start the exporter for NGINX Plus. By default, the exporter is started for NGINX. ($NGINX_PLUS)
119+
--nginx.scrape-uri=http://127.0.0.1:8080/stub_status ...
120+
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.
121+
--[no-]nginx.ssl-verify Perform SSL certificate verification. ($SSL_VERIFY)
122+
--nginx.ssl-ca-cert="" Path to the PEM encoded CA certificate file used to validate the servers SSL certificate. ($SSL_CA_CERT)
123+
--nginx.ssl-client-cert=""
124+
Path to the PEM encoded client certificate file to use when connecting to the server. ($SSL_CLIENT_CERT)
125+
--nginx.ssl-client-key="" Path to the PEM encoded client certificate key file to use when connecting to the server. ($SSL_CLIENT_KEY)
126+
--nginx.timeout=5s A timeout for scraping metrics from NGINX or NGINX Plus. ($TIMEOUT)
127+
--prometheus.const-label=PROMETHEUS.CONST-LABEL ...
128+
Label that will be used in every metric. Format is label=value. It can be repeated multiple times. ($CONST_LABELS)
129+
--log.level=info Only log messages with the given severity or above. One of: [debug, info, warn, error]
130+
--log.format=logfmt Output format of log messages. One of: [logfmt, json]
131+
--[no-]version Show application version.
142132
```
143133

144134
## Exported Metrics
@@ -147,11 +137,17 @@ Usage of ./nginx-prometheus-exporter:
147137

148138
Name | Type | Description | Labels
149139
----|----|----|----|
150-
`nginxexporter_build_info` | Gauge | Shows the exporter build information. | `gitCommit`, `version` |
151-
`nginx_up` | Gauge | Shows the status of the last metric scrape: `1` for a successful scrape and `0` for a failed one | [] |
140+
`nginx_exporter_build_info` | Gauge | Shows the exporter build information. | `branch`, `goarch`, `goos`, `goversion`, `revision`, `tags` and `version` |
141+
`promhttp_metric_handler_requests_total` | Counter | Total number of scrapes by HTTP status code. | `code` (the HTTP status code) |
142+
`promhttp_metric_handler_requests_in_flight` | Gauge | Current number of scrapes being served. | [] |
143+
`go_*` | Multiple | Go runtime metrics. | [] |
152144

153145
### Metrics for NGINX OSS
154146

147+
Name | Type | Description | Labels
148+
----|----|----|----|
149+
`nginx_up` | Gauge | Shows the status of the last metric scrape: `1` for a successful scrape and `0` for a failed one | [] |
150+
155151
#### [Stub status metrics](https://nginx.org/en/docs/http/ngx_http_stub_status_module.html)
156152

157153
Name | Type | Description | Labels
@@ -166,6 +162,10 @@ Name | Type | Description | Labels
166162

167163
### Metrics for NGINX Plus
168164

165+
Name | Type | Description | Labels
166+
----|----|----|----|
167+
`nginxplus_up` | Gauge | Shows the status of the last metric scrape: `1` for a successful scrape and `0` for a failed one | [] |
168+
169169
#### [Connections](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_connections)
170170

171171
Name | Type | Description | Labels
@@ -377,7 +377,7 @@ Name | Type | Description | Labels
377377

378378
Connect to the `/metrics` page of the running exporter to see the complete list of metrics along with their
379379
descriptions. Note: to see server zones related metrics you must configure [status
380-
zones](https://nginx.org/en/docs/http/ngx_http_status_module.html#status_zone) and to see upstream related metrics you
380+
zones](https://nginx.org/en/docs/http/ngx_http_api_module.html#status_zone) and to see upstream related metrics you
381381
must configure upstreams with a [shared memory zone](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#zone).
382382

383383
## Troubleshooting
@@ -389,14 +389,14 @@ logs using [docker logs](https://docs.docker.com/engine/reference/commandline/lo
389389

390390
### Docker images
391391

392-
We publish the Docker image on [DockerHub](https://hub.docker.com/r/nginx/nginx-prometheus-exporter/), [GitHub
393-
Container](https://github.com/nginxinc/nginx-prometheus-exporter/pkgs/container/nginx-prometheus-exporter), [Amazon ECR
394-
Public Gallery](https://gallery.ecr.aws/nginx/nginx-prometheus-exporter) and
392+
We publish the Docker image on [DockerHub](https://hub.docker.com/r/nginx/nginx-prometheus-exporter/),
393+
[GitHub Container](https://github.com/nginxinc/nginx-prometheus-exporter/pkgs/container/nginx-prometheus-exporter),
394+
[Amazon ECR Public Gallery](https://gallery.ecr.aws/nginx/nginx-prometheus-exporter) and
395395
[Quay.io](https://quay.io/repository/nginx/nginx-prometheus-exporter).
396396

397-
As an alternative, you can choose the *edge* version built from the [latest
398-
commit](https://github.com/nginxinc/nginx-prometheus-exporter/commits/main) from the main branch. The edge version is
399-
useful for experimenting with new features that are not yet published in a stable release.
397+
As an alternative, you can choose the *edge* version built from the [latest commit](https://github.com/nginxinc/nginx-prometheus-exporter/commits/main)
398+
from the main branch. The edge version is useful for experimenting with new features that are not yet published in a
399+
stable release.
400400

401401
### Binaries
402402

exporter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ var (
8585
webConfig = kingpinflag.AddFlags(kingpin.CommandLine, ":9113")
8686
metricsPath = kingpin.Flag("web.telemetry-path", "Path under which to expose metrics.").Default("/metrics").Envar("TELEMETRY_PATH").String()
8787
nginxPlus = kingpin.Flag("nginx.plus", "Start the exporter for NGINX Plus. By default, the exporter is started for NGINX.").Default("false").Envar("NGINX_PLUS").Bool()
88-
scrapeURIs = kingpin.Flag("nginx.scrape-uri", "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.").Default("http://127.0.0.1:8080/stub_status").Strings()
88+
scrapeURIs = kingpin.Flag("nginx.scrape-uri", "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.").Default("http://127.0.0.1:8080/stub_status").Strings()
8989
sslVerify = kingpin.Flag("nginx.ssl-verify", "Perform SSL certificate verification.").Default("false").Envar("SSL_VERIFY").Bool()
9090
sslCaCert = kingpin.Flag("nginx.ssl-ca-cert", "Path to the PEM encoded CA certificate file used to validate the servers SSL certificate.").Default("").Envar("SSL_CA_CERT").String()
9191
sslClientCert = kingpin.Flag("nginx.ssl-client-cert", "Path to the PEM encoded client certificate file to use when connecting to the server.").Default("").Envar("SSL_CLIENT_CERT").String()

0 commit comments

Comments
 (0)