Skip to content

Commit

Permalink
upgrade go client and prometheus exporter (#6916)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexFenlon authored Dec 4, 2024
1 parent 48dbe3c commit 39b285d
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 51 deletions.
10 changes: 2 additions & 8 deletions cmd/nginx-ingress/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
cr_validation "github.com/nginxinc/kubernetes-ingress/pkg/apis/configuration/validation"
k8s_nginx "github.com/nginxinc/kubernetes-ingress/pkg/client/clientset/versioned"
conf_scheme "github.com/nginxinc/kubernetes-ingress/pkg/client/clientset/versioned/scheme"
"github.com/nginxinc/nginx-plus-go-client/client"
"github.com/nginxinc/nginx-plus-go-client/v2/client"
nginxCollector "github.com/nginxinc/nginx-prometheus-exporter/collector"
"github.com/prometheus/client_golang/prometheus"
api_v1 "k8s.io/api/core/v1"
Expand All @@ -45,10 +45,6 @@ import (
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
"k8s.io/client-go/tools/record"

kitlog "github.com/go-kit/log"

"github.com/go-kit/log/level"

nl "github.com/nginxinc/kubernetes-ingress/internal/logger"
nic_glog "github.com/nginxinc/kubernetes-ingress/internal/logger/glog"
"github.com/nginxinc/kubernetes-ingress/internal/logger/levels"
Expand Down Expand Up @@ -850,9 +846,7 @@ func createPlusAndLatencyCollectors(
streamServerZoneVariableLabels := []string{"resource_type", "resource_name", "resource_namespace"}
variableLabelNames := nginxCollector.NewVariableLabelNames(upstreamServerVariableLabels, serverZoneVariableLabels, upstreamServerPeerVariableLabelNames,
streamUpstreamServerVariableLabels, streamServerZoneVariableLabels, streamUpstreamServerPeerVariableLabelNames, nil)
logger := kitlog.NewLogfmtLogger(os.Stdout)
logger = level.NewFilter(logger, level.AllowError())
plusCollector = nginxCollector.NewNginxPlusCollector(plusClient, "nginx_ingress_nginxplus", variableLabelNames, constLabels, logger)
plusCollector = nginxCollector.NewNginxPlusCollector(plusClient, "nginx_ingress_nginxplus", variableLabelNames, constLabels, l)
go metrics.RunPrometheusListenerForNginxPlus(ctx, *prometheusMetricsListenPort, plusCollector, registry, prometheusSecret)
} else {
httpClient := getSocketClient("/var/lib/nginx/nginx-status.sock")
Expand Down
8 changes: 3 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ require (
github.com/cert-manager/cert-manager v1.16.2
github.com/dlclark/regexp2 v1.11.4
github.com/gkampitakis/go-snaps v0.5.7
github.com/go-kit/log v0.2.1
github.com/golang-jwt/jwt/v4 v4.5.1
github.com/google/go-cmp v0.6.0
github.com/gruntwork-io/terratest v0.47.2
github.com/jinzhu/copier v0.4.0
github.com/nginxinc/nginx-plus-go-client v1.3.0
github.com/nginxinc/nginx-prometheus-exporter v1.3.0
github.com/nginxinc/nginx-plus-go-client/v2 v2.1.0
github.com/nginxinc/nginx-prometheus-exporter v1.4.0
github.com/nginxinc/nginx-service-mesh v1.7.0
github.com/nginxinc/telemetry-exporter v0.1.2
github.com/prometheus/client_golang v1.20.5
Expand Down Expand Up @@ -68,7 +67,6 @@ require (
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-jose/go-jose/v4 v4.0.4 // indirect
github.com/go-ldap/ldap/v3 v3.4.8 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
Expand Down Expand Up @@ -124,7 +122,7 @@ require (
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/pquerna/otp v1.2.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/common v0.60.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rogpeppe/go-internal v1.13.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
Expand Down
16 changes: 6 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,8 @@ github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxI
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
github.com/go-jose/go-jose/v4 v4.0.4 h1:VsjPI33J0SB9vQM6PLmNjoHqMQNGPiZ0rHL7Ni7Q6/E=
github.com/go-jose/go-jose/v4 v4.0.4/go.mod h1:NKb5HO1EZccyMpiZNbdUw/14tiXNyUJh188dfnMCAfc=
github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=
github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
github.com/go-ldap/ldap/v3 v3.4.8 h1:loKJyspcRezt2Q3ZRMq2p/0v8iOurlmeXDPw6fikSvQ=
github.com/go-ldap/ldap/v3 v3.4.8/go.mod h1:qS3Sjlu76eHfHGpUdWkAXQTw4beih+cHsco2jXlIXrk=
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
Expand Down Expand Up @@ -264,10 +260,10 @@ 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/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
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-prometheus-exporter v1.3.0 h1:1JtdxsZH0Uwhu1nL/j/QyOXytP5V5j68AEo2X+DFWb0=
github.com/nginxinc/nginx-prometheus-exporter v1.3.0/go.mod h1:hXoH+X6aIKSyQuO6QTIiPKH3eZyxqy/wW8GYiE3dflU=
github.com/nginxinc/nginx-plus-go-client/v2 v2.1.0 h1:1ViGtowDeR6339+6ik5rqyyCbxo22M4FxdLuEFdrghI=
github.com/nginxinc/nginx-plus-go-client/v2 v2.1.0/go.mod h1:/ohb6n086OtbLkOHbC+LWkyMG2MwLRnycSGe7+kl2CM=
github.com/nginxinc/nginx-prometheus-exporter v1.4.0 h1:/k4tsYJkNGufzQx4UPbWOOZzifxXKJl9iCklbvXib+Q=
github.com/nginxinc/nginx-prometheus-exporter v1.4.0/go.mod h1:WV8mTXldpz+TUvLwtgadgTgT74+ff1NoHr9ZQnSIYq8=
github.com/nginxinc/nginx-service-mesh v1.7.0 h1:oxKr+Jdbxkos10VTy5xF2UHCcmfIhqWNlsOK/zPnZDM=
github.com/nginxinc/nginx-service-mesh v1.7.0/go.mod h1:8tREM3kSEUGyk8JT8hdCf/9ol2kEo7hLR8b+m5Yd8Fs=
github.com/nginxinc/telemetry-exporter v0.1.2 h1:97vUGhQYgQ2KEsXKCBmr5gqfuujJCKPHwdg5HKoANUs=
Expand All @@ -292,8 +288,8 @@ github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc=
github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8=
github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc=
github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw=
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
Expand Down
10 changes: 5 additions & 5 deletions internal/healthcheck/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
v1 "k8s.io/api/core/v1"

"github.com/nginxinc/kubernetes-ingress/internal/configs"
"github.com/nginxinc/nginx-plus-go-client/client"
"github.com/nginxinc/nginx-plus-go-client/v2/client"
"k8s.io/utils/strings/slices"
)

Expand All @@ -40,9 +40,9 @@ type HealthServer struct {
Server *http.Server
URL string
UpstreamsForHost func(host string) []string
NginxUpstreams func() (*client.Upstreams, error)
NginxUpstreams func(ctx context.Context) (*client.Upstreams, error)
StreamUpstreamsForName func(host string) []string
NginxStreamUpstreams func() (*client.StreamUpstreams, error)
NginxStreamUpstreams func(ctx context.Context) (*client.StreamUpstreams, error)
Logger *slog.Logger
}

Expand Down Expand Up @@ -106,7 +106,7 @@ func (hs *HealthServer) UpstreamStats(w http.ResponseWriter, r *http.Request) {
return
}

upstreams, err := hs.NginxUpstreams()
upstreams, err := hs.NginxUpstreams(context.Background())
if err != nil {
nl.Errorf(hs.Logger, "error retrieving upstreams for requested hostname: %s", host)
w.WriteHeader(http.StatusInternalServerError)
Expand Down Expand Up @@ -144,7 +144,7 @@ func (hs *HealthServer) StreamStats(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
return
}
streams, err := hs.NginxStreamUpstreams()
streams, err := hs.NginxStreamUpstreams(context.Background())
if err != nil {
nl.Errorf(hs.Logger, "error retrieving stream upstreams for requested name: %s", n)
w.WriteHeader(http.StatusInternalServerError)
Expand Down
19 changes: 10 additions & 9 deletions internal/healthcheck/healthcheck_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package healthcheck_test

import (
"context"
"encoding/json"
"errors"
"io"
Expand All @@ -14,7 +15,7 @@ import (

"github.com/google/go-cmp/cmp"
"github.com/nginxinc/kubernetes-ingress/internal/healthcheck"
"github.com/nginxinc/nginx-plus-go-client/client"
"github.com/nginxinc/nginx-plus-go-client/v2/client"
)

// testHandler creates http handler for testing HealthServer.
Expand Down Expand Up @@ -356,7 +357,7 @@ func getUpstreamsForHost(host string) []string {
// Upstreams retrieved using NGINX API client:
// foo.tea.com -> upstream1, upstream2
// bar.tea.com -> upstream2
func getUpstreamsFromNGINXAllUp() (*client.Upstreams, error) {
func getUpstreamsFromNGINXAllUp(_ context.Context) (*client.Upstreams, error) {
ups := client.Upstreams{
"upstream1": client.Upstream{
Peers: []client.Peer{
Expand Down Expand Up @@ -390,7 +391,7 @@ func getUpstreamsFromNGINXAllUp() (*client.Upstreams, error) {
// Upstreams retrieved using NGINX API client:
// foo.tea.com -> upstream1, upstream2
// bar.tea.com -> upstream2
func getUpstreamsFromNGINXAllUnhealthy() (*client.Upstreams, error) {
func getUpstreamsFromNGINXAllUnhealthy(_ context.Context) (*client.Upstreams, error) {
ups := client.Upstreams{
"upstream1": client.Upstream{
Peers: []client.Peer{
Expand Down Expand Up @@ -425,7 +426,7 @@ func getUpstreamsFromNGINXAllUnhealthy() (*client.Upstreams, error) {
// Upstreams retrieved using NGINX API client
// foo.tea.com -> upstream1, upstream2
// bar.tea.com -> upstream2
func getUpstreamsFromNGINXPartiallyUp() (*client.Upstreams, error) {
func getUpstreamsFromNGINXPartiallyUp(_ context.Context) (*client.Upstreams, error) {
ups := client.Upstreams{
"upstream1": client.Upstream{
Peers: []client.Peer{
Expand Down Expand Up @@ -455,14 +456,14 @@ func getUpstreamsFromNGINXPartiallyUp() (*client.Upstreams, error) {
// getUpstreamsFromNGINXNotExistingHost is a helper func used
// for faking response data from NGINX API. It responds
// with empty upstreams on a request for not existing host.
func getUpstreamsFromNGINXNotExistingHost() (*client.Upstreams, error) {
func getUpstreamsFromNGINXNotExistingHost(_ context.Context) (*client.Upstreams, error) {
ups := client.Upstreams{}
return &ups, nil
}

// getUpstreamsFromNGINXErrorFromAPI is a helper func used
// for faking err response from NGINX API client.
func getUpstreamsFromNGINXErrorFromAPI() (*client.Upstreams, error) {
func getUpstreamsFromNGINXErrorFromAPI(_ context.Context) (*client.Upstreams, error) {
return nil, errors.New("nginx api error")
}

Expand All @@ -483,7 +484,7 @@ func streamUpstreamsForName(name string) []string {
// for faking response from NGINX Plus client.
//
//nolint:unparam
func streamUpstreamsFromNGINXAllUp() (*client.StreamUpstreams, error) {
func streamUpstreamsFromNGINXAllUp(_ context.Context) (*client.StreamUpstreams, error) {
streamUpstreams := client.StreamUpstreams{
"streamUpstream1": client.StreamUpstream{
Peers: []client.StreamPeer{
Expand All @@ -507,7 +508,7 @@ func streamUpstreamsFromNGINXAllUp() (*client.StreamUpstreams, error) {
// for faking response from NGINX Plus client.
//
//nolint:unparam
func streamUpstreamsFromNGINXPartiallyUp() (*client.StreamUpstreams, error) {
func streamUpstreamsFromNGINXPartiallyUp(_ context.Context) (*client.StreamUpstreams, error) {
streamUpstreams := client.StreamUpstreams{
"streamUpstream1": client.StreamUpstream{
Peers: []client.StreamPeer{
Expand All @@ -531,7 +532,7 @@ func streamUpstreamsFromNGINXPartiallyUp() (*client.StreamUpstreams, error) {
// for faking response from NGINX Plus client.
//
//nolint:unparam
func streamUpstreamsFromNGINXAllPeersDown() (*client.StreamUpstreams, error) {
func streamUpstreamsFromNGINXAllPeersDown(_ context.Context) (*client.StreamUpstreams, error) {
streamUpstreams := client.StreamUpstreams{
"streamUpstream1": client.StreamUpstream{
Peers: []client.StreamPeer{
Expand Down
7 changes: 1 addition & 6 deletions internal/metrics/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ import (
"fmt"
"log/slog"
"net/http"
"os"
"strconv"
"time"

kitlog "github.com/go-kit/log"
"github.com/go-kit/log/level"
prometheusClient "github.com/nginxinc/nginx-prometheus-exporter/client"
nginxCollector "github.com/nginxinc/nginx-prometheus-exporter/collector"
"github.com/prometheus/client_golang/prometheus"
Expand All @@ -29,9 +26,7 @@ func NewNginxMetricsClient(httpClient *http.Client) *prometheusClient.NginxClien

// RunPrometheusListenerForNginx runs an http server to expose Prometheus metrics for NGINX
func RunPrometheusListenerForNginx(ctx context.Context, port int, client *prometheusClient.NginxClient, registry *prometheus.Registry, constLabels map[string]string, prometheusSecret *v1.Secret) {
logger := kitlog.NewLogfmtLogger(os.Stdout)
logger = level.NewFilter(logger, level.AllowError())
registry.MustRegister(nginxCollector.NewNginxCollector(client, "nginx_ingress_nginx", constLabels, logger))
registry.MustRegister(nginxCollector.NewNginxCollector(client, "nginx_ingress_nginx", constLabels, nl.LoggerFromContext(ctx)))
runServer(ctx, strconv.Itoa(port), registry, prometheusSecret)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/nginx/fake_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
nl "github.com/nginxinc/kubernetes-ingress/internal/logger"
nic_glog "github.com/nginxinc/kubernetes-ingress/internal/logger/glog"
"github.com/nginxinc/kubernetes-ingress/internal/logger/levels"
"github.com/nginxinc/nginx-plus-go-client/client"
"github.com/nginxinc/nginx-plus-go-client/v2/client"
)

// FakeManager provides a fake implementation of the Manager interface.
Expand Down
12 changes: 6 additions & 6 deletions internal/nginx/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
nl "github.com/nginxinc/kubernetes-ingress/internal/logger"
"github.com/nginxinc/kubernetes-ingress/internal/metrics/collectors"

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

const (
Expand Down Expand Up @@ -432,7 +432,7 @@ func (lm *LocalManager) UpdateServersInPlus(upstream string, servers []string, c
})
}

added, removed, updated, err := lm.plusClient.UpdateHTTPServers(upstream, upsServers)
added, removed, updated, err := lm.plusClient.UpdateHTTPServers(context.Background(), upstream, upsServers)
if err != nil {
nl.Debugf(lm.logger, "Couldn't update servers of %v upstream: %v", upstream, err)
return fmt.Errorf("error updating servers of %v upstream: %w", upstream, err)
Expand Down Expand Up @@ -487,7 +487,7 @@ func (lm *LocalManager) UpdateStreamServersInPlus(upstream string, servers []str
})
}

added, removed, updated, err := lm.plusClient.UpdateStreamServers(upstream, upsServers)
added, removed, updated, err := lm.plusClient.UpdateStreamServers(context.Background(), upstream, upsServers)
if err != nil {
nl.Debugf(lm.logger, "Couldn't update stream servers of %v upstream: %v", upstream, err)
return fmt.Errorf("error updating stream servers of %v upstream: %w", upstream, err)
Expand Down Expand Up @@ -699,7 +699,7 @@ func (lm *LocalManager) UpsertSplitClientsKeyVal(zoneName, key, value string) {
key = strings.Trim(key, "\"")
value = strings.Trim(value, "\"")

keyValPairs, err := lm.plusClient.GetKeyValPairs(zoneName)
keyValPairs, err := lm.plusClient.GetKeyValPairs(context.Background(), zoneName)
if err != nil {
lm.tryAddKeyValPair(zoneName, key, value)
return
Expand All @@ -713,7 +713,7 @@ func (lm *LocalManager) UpsertSplitClientsKeyVal(zoneName, key, value string) {
}

func (lm *LocalManager) tryAddKeyValPair(zoneName, key, value string) {
err := lm.plusClient.AddKeyValPair(zoneName, key, value)
err := lm.plusClient.AddKeyValPair(context.Background(), zoneName, key, value)
if err != nil {
nl.Warnf(lm.logger, "Failed to add key value pair: %v", err)
} else {
Expand All @@ -722,7 +722,7 @@ func (lm *LocalManager) tryAddKeyValPair(zoneName, key, value string) {
}

func (lm *LocalManager) tryModifyKeyValPair(zoneName, key, value string) {
err := lm.plusClient.ModifyKeyValPair(zoneName, key, value)
err := lm.plusClient.ModifyKeyValPair(context.Background(), zoneName, key, value)
if err != nil {
nl.Warnf(lm.logger, "Failed to modify key value pair: %v", err)
} else {
Expand Down
2 changes: 1 addition & 1 deletion internal/nginx/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nginx
import (
"testing"

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

// Helper functions to create pointers
Expand Down

0 comments on commit 39b285d

Please sign in to comment.