Skip to content

Commit

Permalink
Update module github.com/nginxinc/nginx-plus-go-client to v2 (#855)
Browse files Browse the repository at this point in the history
* Update module github.com/nginxinc/nginx-plus-go-client to v2

| datasource | package                                  | from   | to     |
| ---------- | ---------------------------------------- | ------ | ------ |
| go         | github.com/nginxinc/nginx-plus-go-client | v1.3.0 | v2.0.1 |


Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Use context.TODO for now

* Add issue

---------

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Luca Comellini <[email protected]>
  • Loading branch information
renovate[bot] and lucacome authored Sep 26, 2024
1 parent 262228e commit 5db1c05
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions collector/nginx_plus.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package collector

import (
"context"
"fmt"
"log/slog"
"strconv"
"sync"

plusclient "github.com/nginxinc/nginx-plus-go-client/client"
plusclient "github.com/nginxinc/nginx-plus-go-client/v2/client"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down Expand Up @@ -622,7 +623,8 @@ func (c *NginxPlusCollector) Collect(ch chan<- prometheus.Metric) {
c.mutex.Lock() // To protect metrics from concurrent collects
defer c.mutex.Unlock()

stats, err := c.nginxClient.GetStats()
// FIXME: https://github.com/nginxinc/nginx-prometheus-exporter/issues/858
stats, err := c.nginxClient.GetStats(context.TODO())
if err != nil {
c.upMetric.Set(nginxDown)
ch <- c.upMetric
Expand Down
2 changes: 1 addition & 1 deletion exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"syscall"
"time"

plusclient "github.com/nginxinc/nginx-plus-go-client/client"
plusclient "github.com/nginxinc/nginx-plus-go-client/v2/client"
"github.com/nginxinc/nginx-prometheus-exporter/client"
"github.com/nginxinc/nginx-prometheus-exporter/collector"

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22.6

require (
github.com/alecthomas/kingpin/v2 v2.4.0
github.com/nginxinc/nginx-plus-go-client v1.3.0
github.com/nginxinc/nginx-plus-go-client/v2 v2.0.1
github.com/prometheus/client_golang v1.20.4
github.com/prometheus/common v0.59.1
github.com/prometheus/exporter-toolkit v0.13.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nginxinc/nginx-plus-go-client v1.3.0 h1:q/aeT4B5k0KLwWlefoBzfLfraBBvIKLuDg+lLFWAo4I=
github.com/nginxinc/nginx-plus-go-client v1.3.0/go.mod h1:n8OFLzrJulJ2fur28Cwa1Qp5DZNS2VicLV+Adt30LQ4=
github.com/nginxinc/nginx-plus-go-client/v2 v2.0.1 h1:5VVK38bnELMDWnwfF6dSv57ResXh9AUzeDa72ENj94o=
github.com/nginxinc/nginx-plus-go-client/v2 v2.0.1/go.mod h1:He+1izxYxVVO5/C9ZTukwOpvkAx5eS19nRQgKXDhX5I=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI=
Expand Down

0 comments on commit 5db1c05

Please sign in to comment.