Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
veezhang committed Jul 6, 2021
1 parent d03f18d commit aedc801
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func (exporter *NebulaExporter) CollectMetrics(
}
}

func (exporter *NebulaExporter) collect(wg *sync.WaitGroup, clusterName string, instance Instance, ch chan<- prometheus.Metric) {
func (exporter *NebulaExporter) collect(wg *sync.WaitGroup, namespace, clusterName string, instance Instance, ch chan<- prometheus.Metric) {
podIpAddress := instance.EndpointIP
podHttpPort := instance.EndpointPort

Expand All @@ -404,7 +404,7 @@ func (exporter *NebulaExporter) collect(wg *sync.WaitGroup, clusterName string,
klog.Infof("metrics from %s:%d was empty", podIpAddress, podHttpPort)
return
}
exporter.CollectMetrics(instance.Name, instance.ComponentType, DefaultStaticNamespace, clusterName, metrics, ch)
exporter.CollectMetrics(instance.Name, instance.ComponentType, namespace, clusterName, metrics, ch)
}()

wg.Add(1)
Expand All @@ -419,7 +419,7 @@ func (exporter *NebulaExporter) collect(wg *sync.WaitGroup, clusterName string,
klog.Errorf("could not get status metrics from %s:%d", podIpAddress, podHttpPort)
return
}
exporter.CollectMetrics(instance.Name, instance.ComponentType, DefaultStaticNamespace, clusterName, statusMetrics, ch)
exporter.CollectMetrics(instance.Name, instance.ComponentType, namespace, clusterName, statusMetrics, ch)
}()
}

Expand All @@ -429,7 +429,7 @@ func (exporter *NebulaExporter) CollectFromStaticConfig(ch chan<- prometheus.Met
cluster := cluster
for _, instance := range cluster.Instances {
instance := instance
exporter.collect(&wg, cluster.Name, instance, ch)
exporter.collect(&wg, DefaultStaticNamespace, cluster.Name, instance, ch)
}
}

Expand Down Expand Up @@ -473,7 +473,7 @@ func (exporter *NebulaExporter) CollectFromKubernetes(ch chan<- prometheus.Metri
continue
}

exporter.collect(&wg, clusterName, Instance{
exporter.collect(&wg, pod.Namespace, clusterName, Instance{
Name: pod.Name,
EndpointIP: podIpAddress,
EndpointPort: podHttpPort,
Expand Down

0 comments on commit aedc801

Please sign in to comment.