Skip to content

Commit 7154d57

Browse files
committed
adding lint fix update
1 parent 7be17ee commit 7154d57

File tree

1 file changed

+8
-1
lines changed
  • internal/mode/static/metrics/collectors

1 file changed

+8
-1
lines changed

internal/mode/static/metrics/collectors/nginx.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package collectors
22

33
import (
4+
"fmt"
5+
46
"github.com/go-kit/log"
7+
"github.com/nginxinc/nginx-plus-go-client/client"
58
prometheusClient "github.com/nginxinc/nginx-prometheus-exporter/client"
69
nginxCollector "github.com/nginxinc/nginx-prometheus-exporter/collector"
710
"github.com/prometheus/client_golang/prometheus"
@@ -29,8 +32,12 @@ func NewNginxPlusMetricsCollector(
2932
constLabels map[string]string,
3033
logger log.Logger,
3134
) (prometheus.Collector, error) {
35+
nc, ok := plusClient.(*client.NginxClient)
36+
if !ok {
37+
panic(fmt.Sprintf("expected *client.NginxClient, got %T", plusClient))
38+
}
3239
collector := nginxCollector.NewNginxPlusCollector(
33-
plusClient,
40+
nc,
3441
metrics.Namespace,
3542
nginxCollector.VariableLabelNames{},
3643
constLabels,

0 commit comments

Comments
 (0)