Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update module github.com/nginxinc/nginx-plus-go-client to v2 #855

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 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,7 @@
c.mutex.Lock() // To protect metrics from concurrent collects
defer c.mutex.Unlock()

stats, err := c.nginxClient.GetStats()
stats, err := c.nginxClient.GetStats(context.TODO())

Check warning on line 626 in collector/nginx_plus.go

View check run for this annotation

Codecov / codecov/patch

collector/nginx_plus.go#L626

Added line #L626 was not covered by tests
kate-osborn marked this conversation as resolved.
Show resolved Hide resolved
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