1
0
mirror of https://github.com/nginxinc/nginx-prometheus-exporter.git synced 2025-08-08 05:02:04 +03:00

Add variable labels to Upstream Servers and Server Zones metrics

This commit is contained in:
Raul Marrero
2020-07-31 17:15:35 +01:00
committed by Raúl
parent e2285a5ffa
commit 66a9427a40
2 changed files with 161 additions and 61 deletions

View File

@@ -372,7 +372,8 @@ func main() {
if err != nil {
log.Fatalf("Could not create Nginx Plus Client: %v", err)
}
registry.MustRegister(collector.NewNginxPlusCollector(plusClient.(*plusclient.NginxClient), "nginxplus", constLabels.labels))
variableLabelNames := collector.NewVariableLabelNames(nil, nil)
registry.MustRegister(collector.NewNginxPlusCollector(plusClient.(*plusclient.NginxClient), "nginxplus", variableLabelNames, constLabels.labels))
} else {
ossClient, err := createClientWithRetries(func() (interface{}, error) {
return client.NewNginxClient(httpClient, *scrapeURI)