File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
internal/mode/static/metrics/collectors Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 11package collectors
22
33import (
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 ,
You can’t perform that action at this time.
0 commit comments