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 1
1
package collectors
2
2
3
3
import (
4
+ "fmt"
5
+
4
6
"github.com/go-kit/log"
7
+ "github.com/nginxinc/nginx-plus-go-client/client"
5
8
prometheusClient "github.com/nginxinc/nginx-prometheus-exporter/client"
6
9
nginxCollector "github.com/nginxinc/nginx-prometheus-exporter/collector"
7
10
"github.com/prometheus/client_golang/prometheus"
@@ -29,8 +32,12 @@ func NewNginxPlusMetricsCollector(
29
32
constLabels map [string ]string ,
30
33
logger log.Logger ,
31
34
) (prometheus.Collector , error ) {
35
+ nc , ok := plusClient .(* client.NginxClient )
36
+ if ! ok {
37
+ panic (fmt .Sprintf ("expected *client.NginxClient, got %T" , plusClient ))
38
+ }
32
39
collector := nginxCollector .NewNginxPlusCollector (
33
- plusClient ,
40
+ nc ,
34
41
metrics .Namespace ,
35
42
nginxCollector.VariableLabelNames {},
36
43
constLabels ,
You can’t perform that action at this time.
0 commit comments