From 5db1c05747594ff4c1111bedfebc32bd5124f813 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:36:30 -0600 Subject: [PATCH] Update module github.com/nginxinc/nginx-plus-go-client to v2 (#855) * 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 --- collector/nginx_plus.go | 6 ++++-- exporter.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/collector/nginx_plus.go b/collector/nginx_plus.go index d6baab09..0f524ff1 100644 --- a/collector/nginx_plus.go +++ b/collector/nginx_plus.go @@ -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" ) @@ -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 diff --git a/exporter.go b/exporter.go index cfed2a8e..7f165444 100644 --- a/exporter.go +++ b/exporter.go @@ -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" diff --git a/go.mod b/go.mod index 5825f43b..30d078d5 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 3c996d7f..caec8fb3 100644 --- a/go.sum +++ b/go.sum @@ -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=