Bump cAdvisor to v0.23.3

This commit is contained in:
Tim St. Clair
2016-06-08 11:57:20 -07:00
parent 3d332a047b
commit cf1ee6c694
4 changed files with 113 additions and 85 deletions

View File

@@ -120,12 +120,18 @@ func (collector *PrometheusCollector) GetSpec() []v1.MetricSpec {
}
lines := strings.Split(string(pageContent), "\n")
lineCount := len(lines)
for i, line := range lines {
if strings.HasPrefix(line, "# HELP") {
stopIndex := strings.Index(lines[i+2], "{")
if stopIndex == -1 {
stopIndex = strings.Index(lines[i+2], " ")
if i+2 >= lineCount {
break
}
stopIndex := strings.IndexAny(lines[i+2], "{ ")
if stopIndex == -1 {
continue
}
name := strings.TrimSpace(lines[i+2][0:stopIndex])
if _, ok := collector.metricsSet[name]; collector.metricsSet != nil && !ok {
continue