@@ -23,15 +23,6 @@ const (
23
23
nginxStatusSockTimeout = 10 * time .Second
24
24
)
25
25
26
- var (
27
- upstreamServerVariableLabels = []string {}
28
- upstreamServerPeerVariableLabelNames = []string {}
29
- streamUpstreamServerVariableLabels = []string {}
30
- streamUpstreamServerPeerVariableLabelNames = []string {}
31
- serverZoneVariableLabels = []string {}
32
- streamServerZoneVariableLabels = []string {}
33
- )
34
-
35
26
// NewNginxMetricsCollector creates an NginxCollector which fetches stats from NGINX over a unix socket
36
27
func NewNginxMetricsCollector (constLabels map [string ]string ) (prometheus.Collector , error ) {
37
28
httpClient := getSocketClient (nginxStatusSock )
@@ -43,20 +34,13 @@ func NewNginxMetricsCollector(constLabels map[string]string) (prometheus.Collect
43
34
return nginxCollector .NewNginxCollector (client , metrics .Namespace , constLabels ), nil
44
35
}
45
36
46
- // NewNginxMetricsCollector creates an NginxCollector which fetches stats from NGINX over a unix socket
37
+ // NewNginxPlusMetricsCollector creates an NginxCollector which fetches stats from NGINX Plus API over a unix socket
47
38
func NewNginxPlusMetricsCollector (constLabels map [string ]string ) (prometheus.Collector , error ) {
48
39
plusClient , err := createPlusClient ()
49
40
if err != nil {
50
41
return nil , err
51
42
}
52
- variableLabelNames := nginxCollector .NewVariableLabelNames (
53
- upstreamServerVariableLabels ,
54
- serverZoneVariableLabels ,
55
- upstreamServerPeerVariableLabelNames ,
56
- streamUpstreamServerVariableLabels ,
57
- streamServerZoneVariableLabels ,
58
- streamUpstreamServerPeerVariableLabelNames ,
59
- )
43
+ variableLabelNames := nginxCollector.VariableLabelNames {}
60
44
return nginxCollector .NewNginxPlusCollector (plusClient , metrics .Namespace , variableLabelNames , constLabels ), nil
61
45
}
62
46
0 commit comments