File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,8 @@ Usage of ./nginx-prometheus-exporter:
7979
8080### Exported Metrics
8181
82+ * Common metrics:
83+ * `nginxexporter_build_info` -- shows the exporter build information.
8284* For NGINX, the following metrics are exported:
8385 * All [stub_status](http://nginx.org/en/docs/http/ngx_http_stub_status_module.html) metrics.
8486 * `nginx_up` -- shows the status of the last metric scrape: `1` for a successful scrape and `0` for a failed one.
Original file line number Diff line number Diff line change @@ -70,6 +70,20 @@ func main() {
7070
7171 registry := prometheus .NewRegistry ()
7272
73+ buildInfoMetric := prometheus .NewGauge (
74+ prometheus.GaugeOpts {
75+ Name : "nginxexporter_build_info" ,
76+ Help : "Exporter build information" ,
77+ ConstLabels : prometheus.Labels {
78+ "version" : version ,
79+ "gitCommit" : gitCommit ,
80+ },
81+ },
82+ )
83+ buildInfoMetric .Set (1 )
84+
85+ registry .MustRegister (buildInfoMetric )
86+
7387 httpClient := & http.Client {
7488 Timeout : * timeout ,
7589 Transport : & http.Transport {
You can’t perform that action at this time.
0 commit comments