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:
79
79
80
80
### Exported Metrics
81
81
82
+ * Common metrics:
83
+ * `nginxexporter_build_info` -- shows the exporter build information.
82
84
* For NGINX, the following metrics are exported:
83
85
* All [stub_status](http://nginx.org/en/docs/http/ngx_http_stub_status_module.html) metrics.
84
86
* `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() {
70
70
71
71
registry := prometheus .NewRegistry ()
72
72
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
+
73
87
httpClient := & http.Client {
74
88
Timeout : * timeout ,
75
89
Transport : & http.Transport {
You can’t perform that action at this time.
0 commit comments