File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 11package collector
22
33import (
4+ "context"
45 "fmt"
56 "log/slog"
67 "strconv"
78 "sync"
89
9- plusclient "github.com/nginxinc/nginx-plus-go-client/client"
10+ plusclient "github.com/nginxinc/nginx-plus-go-client/v2/ client"
1011 "github.com/prometheus/client_golang/prometheus"
1112)
1213
@@ -622,7 +623,8 @@ func (c *NginxPlusCollector) Collect(ch chan<- prometheus.Metric) {
622623 c .mutex .Lock () // To protect metrics from concurrent collects
623624 defer c .mutex .Unlock ()
624625
625- stats , err := c .nginxClient .GetStats ()
626+ // FIXME: https://github.com/nginxinc/nginx-prometheus-exporter/issues/858
627+ stats , err := c .nginxClient .GetStats (context .TODO ())
626628 if err != nil {
627629 c .upMetric .Set (nginxDown )
628630 ch <- c .upMetric
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import (
1616 "syscall"
1717 "time"
1818
19- plusclient "github.com/nginxinc/nginx-plus-go-client/client"
19+ plusclient "github.com/nginxinc/nginx-plus-go-client/v2/ client"
2020 "github.com/nginxinc/nginx-prometheus-exporter/client"
2121 "github.com/nginxinc/nginx-prometheus-exporter/collector"
2222
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ go 1.22.6
44
55require (
66 github.com/alecthomas/kingpin/v2 v2.4.0
7- github.com/nginxinc/nginx-plus-go-client v1.3.0
7+ github.com/nginxinc/nginx-plus-go-client/v2 v2.0.1
88 github.com/prometheus/client_golang v1.20.4
99 github.com/prometheus/common v0.59.1
1010 github.com/prometheus/exporter-toolkit v0.13.0
Original file line number Diff line number Diff line change @@ -32,8 +32,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
3232github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 /go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ =
3333github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU =
3434github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f /go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U =
35- github.com/nginxinc/nginx-plus-go-client v1.3.0 h1:q/aeT4B5k0KLwWlefoBzfLfraBBvIKLuDg+lLFWAo4I =
36- github.com/nginxinc/nginx-plus-go-client v1.3.0 /go.mod h1:n8OFLzrJulJ2fur28Cwa1Qp5DZNS2VicLV+Adt30LQ4 =
35+ github.com/nginxinc/nginx-plus-go-client/v2 v2.0.1 h1:5VVK38bnELMDWnwfF6dSv57ResXh9AUzeDa72ENj94o =
36+ github.com/nginxinc/nginx-plus-go-client/v2 v2.0.1 /go.mod h1:He+1izxYxVVO5/C9ZTukwOpvkAx5eS19nRQgKXDhX5I =
3737github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM =
3838github.com/pmezard/go-difflib v1.0.0 /go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4 =
3939github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI =
You can’t perform that action at this time.
0 commit comments