Skip to content

Commit

Permalink
experimental fix
Browse files Browse the repository at this point in the history
  • Loading branch information
miledxz committed Aug 21, 2024
1 parent eda39b2 commit 7be17ee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions internal/mode/static/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"time"

"github.com/go-logr/logr"
ngxclient "github.com/nginxinc/nginx-plus-go-client/client"
tel "github.com/nginxinc/telemetry-exporter/pkg/telemetry"
"github.com/prometheus/client_golang/prometheus"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
Expand Down Expand Up @@ -159,7 +158,7 @@ func StartManager(cfg config.Config) error {
handlerCollector handlerMetricsCollector = collectors.NewControllerNoopCollector()
)

var ngxPlusClient *ngxclient.NginxClient
var ngxPlusClient ngxruntime.NginxPlusClient
var usageSecret *usage.Secret

if cfg.Plus {
Expand Down
3 changes: 1 addition & 2 deletions internal/mode/static/metrics/collectors/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package collectors

import (
"github.com/go-kit/log"
"github.com/nginxinc/nginx-plus-go-client/client"
prometheusClient "github.com/nginxinc/nginx-prometheus-exporter/client"
nginxCollector "github.com/nginxinc/nginx-prometheus-exporter/collector"
"github.com/prometheus/client_golang/prometheus"
Expand All @@ -26,7 +25,7 @@ func NewNginxMetricsCollector(constLabels map[string]string, logger log.Logger)

// NewNginxPlusMetricsCollector creates an NginxCollector which fetches stats from NGINX Plus API over a unix socket.
func NewNginxPlusMetricsCollector(
plusClient *client.NginxClient,
plusClient runtime.NginxPlusClient,
constLabels map[string]string,
logger log.Logger,
) (prometheus.Collector, error) {
Expand Down
6 changes: 3 additions & 3 deletions internal/mode/static/nginx/runtime/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var childProcPathFmt = "/proc/%[1]v/task/%[1]v/children"

//counterfeiter:generate . nginxPlusClient

type nginxPlusClient interface {
type NginxPlusClient interface {
UpdateHTTPServers(
upstream string,
servers []ngxclient.UpstreamServer,
Expand Down Expand Up @@ -79,13 +79,13 @@ type ManagerImpl struct {
processHandler ProcessHandler
metricsCollector MetricsCollector
verifyClient nginxConfigVerifier
ngxPlusClient nginxPlusClient
ngxPlusClient NginxPlusClient
logger logr.Logger
}

// NewManagerImpl creates a new ManagerImpl.
func NewManagerImpl(
ngxPlusClient nginxPlusClient,
ngxPlusClient NginxPlusClient,
collector MetricsCollector,
logger logr.Logger,
processHandler ProcessHandler,
Expand Down

0 comments on commit 7be17ee

Please sign in to comment.